aboutsummaryrefslogtreecommitdiff
path: root/rootston/ini.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-04-13 08:31:09 -0400
committerGitHub <noreply@github.com>2018-04-13 08:31:09 -0400
commit4dbf7f8b8832bb16940527c18765131f7bbf83b2 (patch)
tree262b21eac2b3c06047d697a81bd899ddcf09ed4b /rootston/ini.c
parent65903d26775789608bb336ecde03259e94b3a6d7 (diff)
parent555206cf6041c0ab8c83f3a9860cd794a7be255c (diff)
Merge pull request #865 from martinetd/str_truncation
Fix gcc string truncation warnings
Diffstat (limited to 'rootston/ini.c')
-rw-r--r--rootston/ini.c2
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;
}