Fix format-truncation warning, missing string.h inclusion and strnlen warning (#723)
[proxmark3-svn] / client / ui.c
index 3a1e42c523786b2771f74eb94d08731e4d474dcc..5c9d7424a614189ef5347b2acc8db6600bb4732e 100644 (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);
        }
 }
Impressum, Datenschutz