diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2018-04-05 13:58:23 +0900 |
---|---|---|
committer | Dominique Martinet <asmadeus@codewreck.org> | 2018-04-13 14:37:53 +0900 |
commit | 555206cf6041c0ab8c83f3a9860cd794a7be255c (patch) | |
tree | e7b3d316008d1cda7c6863a9c2aa0780a70b9f6c /rootston/ini.c | |
parent | 99b92b4104bf7bdd7663289c71f6cf0933e16a0f (diff) |
Fix gcc string truncation warnings
Diffstat (limited to 'rootston/ini.c')
-rw-r--r-- | rootston/ini.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rootston/ini.c b/rootston/ini.c index 56cc9ea6..f515dd38 100644 --- a/rootston/ini.c +++ b/rootston/ini.c @@ -64,7 +64,7 @@ static char* find_chars_or_comment(const char* s, const char* chars) /* Version of strncpy that ensures dest (size bytes) is null-terminated. */ 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; } |