aboutsummaryrefslogtreecommitdiffstats
path: root/lib/INIReader.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/INIReader.h')
-rw-r--r--lib/INIReader.h2
1 files changed, 1 insertions, 1 deletions
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;
}