diff options
Diffstat (limited to 'src/basic/string-util.c')
-rw-r--r-- | src/basic/string-util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/string-util.c b/src/basic/string-util.c index 3287865863..5808b1280e 100644 --- a/src/basic/string-util.c +++ b/src/basic/string-util.c @@ -558,7 +558,7 @@ bool nulstr_contains(const char *nulstr, const char *needle) { char* strshorten(char *s, size_t l) { assert(s); - if (l < strlen(s)) + if (strnlen(s, l+1) > l) s[l] = 0; return s; |