forked from Archive/PX4-Autopilot
Fix -Werror=stringop-overflow on gcc 7
The error was: Firmware/src/systemcmds/hardfault_log/hardfault_log.c:312:7: error: specified bound 30 equals the size of the destination [-Werror=stringop-overflow=] strncat(marker, sp_name, sizeof(marker)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
parent
abcb920df4
commit
61d6903b40
|
@ -311,16 +311,16 @@ static int write_stack(bool inValid, int winsize, uint32_t wtopaddr,
|
|||
for (int i = 0; i < chunk; i++) {
|
||||
if (wtopaddr == topaddr) {
|
||||
strncpy(marker, "<-- ", sizeof(marker));
|
||||
strncat(marker, sp_name, sizeof(marker));
|
||||
strncat(marker, sp_name, sizeof(marker) - 1);
|
||||
strncat(marker, " top", sizeof(marker));
|
||||
|
||||
} else if (wtopaddr == spaddr) {
|
||||
strncpy(marker, "<-- ", sizeof(marker));
|
||||
strncat(marker, sp_name, sizeof(marker));
|
||||
strncat(marker, sp_name, sizeof(marker) - 1);
|
||||
|
||||
} else if (wtopaddr == botaddr) {
|
||||
strncpy(marker, "<-- ", sizeof(marker));
|
||||
strncat(marker, sp_name, sizeof(marker));
|
||||
strncat(marker, sp_name, sizeof(marker) - 1);
|
||||
strncat(marker, " bottom", sizeof(marker));
|
||||
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue