From 554011f82888e8c1ae14984d20e0d5f34d93f23b Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sun, 10 Mar 2019 00:09:38 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20warning:=20=E2=80=98strncpy=E2=80=99=20ou?= =?UTF-8?q?tput=20truncated=20before=20terminating=20nul=20copying=20as=20?= =?UTF-8?q?many=20bytes=20from=20a=20string=20as=20its=20length?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/jansson/error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/jansson/error.c b/client/jansson/error.c index 8532e04ff..dd4d1605f 100644 --- a/client/jansson/error.c +++ b/client/jansson/error.c @@ -24,7 +24,7 @@ void jsonp_error_set_source(json_error_t *error, const char *source) length = strlen(source); if (length < JSON_ERROR_SOURCE_LENGTH) { - strncpy(error->source, source, length); + strncpy(error->source, source, JSON_ERROR_SOURCE_LENGTH); } else { size_t extra = length - JSON_ERROR_SOURCE_LENGTH + 4; memcpy(error->source, "...", 3);