summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-05-14 11:15:44 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-05-14 11:15:44 +0200
commit48629221282790e1f574f1a400e909b4b7914bb2 (patch)
tree379a0ed01bf46a02230e9e9d59cfd8cb9e4955bd /lib
parent6abb6defb379880000a7a8bb2021537e4ca53007 (diff)
downloaddabmod-48629221282790e1f574f1a400e909b4b7914bb2.tar.gz
dabmod-48629221282790e1f574f1a400e909b4b7914bb2.tar.bz2
dabmod-48629221282790e1f574f1a400e909b4b7914bb2.zip
Fix warning about INIReader strncpy
Diffstat (limited to 'lib')
-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;
}