Skip to content
Snippets Groups Projects
Commit 66226fb7 authored by Lorenz Meier's avatar Lorenz Meier Committed by Beat Küng
Browse files

Land detector: Harden string handling

Due to known input this was not a real issue, but bad style.
parent 1a1522d3
No related branches found
No related tags found
No related merge requests found
......@@ -159,8 +159,9 @@ static int land_detector_start(const char *mode)
}
}
//Remember current active mode
strncpy(_currentMode, mode, 12);
// Remember current active mode
strncpy(_currentMode, mode, sizeof(_currentMode) - 1);
_currentMode[sizeof(_currentMode) - 1] = '\0';
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment