Fix format-truncation warning, missing string.h inclusion and strnlen warning (#723)

* Fix format-truncation warning, missing string.h inclusion and strnlen warning

* Dynamic string width field
This commit is contained in:
Fl0-0 2018-11-30 09:03:44 +01:00 committed by pwpiwi
parent 6a2bd85719
commit 994f21fe01
2 changed files with 4 additions and 1 deletions

View file

@ -99,7 +99,7 @@ void PrintAndLogEx(logLevel_t level, char *fmt, ...) {
}
PrintAndLog(buffer2);
} else {
snprintf(buffer2, sizeof(buffer2), "%s%s", prefix, buffer);
snprintf(buffer2, sizeof(buffer2), "%s%.*s", prefix, MAX_PRINT_BUFFER - 20, buffer);
PrintAndLog(buffer2);
}
}