From 48629221282790e1f574f1a400e909b4b7914bb2 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 14 May 2018 11:15:44 +0200 Subject: Fix warning about INIReader strncpy --- lib/INIReader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/INIReader.h b/lib/INIReader.h index 63d5e64..0aa8885 100644 --- a/lib/INIReader.h +++ b/lib/INIReader.h @@ -178,7 +178,7 @@ inline static char* find_chars_or_comment(const char* s, const char* chars) /* Version of strncpy that ensures dest (size bytes) is null-terminated. */ inline static char* strncpy0(char* dest, const char* src, size_t size) { - strncpy(dest, src, size); + strncpy(dest, src, size - 1); dest[size - 1] = '\0'; return dest; } -- cgit v1.2.3