From e04132b9aa9ac47ce2e1f2d1c6a7a67607b8d0b7 Mon Sep 17 00:00:00 2001 From: Fl0-0 Date: Mon, 26 Nov 2018 09:52:31 +0100 Subject: [PATCH] Fix format-truncation warning, missing string.h inclusion and strnlen warning --- client/crypto/asn1dump.c | 3 +++ client/ui.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/client/crypto/asn1dump.c b/client/crypto/asn1dump.c index 60799fc8..9570be20 100644 --- a/client/crypto/asn1dump.c +++ b/client/crypto/asn1dump.c @@ -8,11 +8,14 @@ // asn.1 dumping //----------------------------------------------------------------------------- +#define _POSIX_C_SOURCE 200809L // need for strnlen() + #include "asn1dump.h" #include #include #include #include +#include #include #include #include diff --git a/client/ui.c b/client/ui.c index 3a1e42c5..2644b190 100644 --- a/client/ui.c +++ b/client/ui.c @@ -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%.2028s", prefix, buffer); PrintAndLog(buffer2); } }