diff options
-rw-r--r-- | src/util/ralloc.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/util/ralloc.c b/src/util/ralloc.c index 7bf192e0db7..953f36e6bcd 100644 --- a/src/util/ralloc.c +++ b/src/util/ralloc.c @@ -405,12 +405,7 @@ ralloc_strcat(char **dest, const char *str) bool ralloc_strncat(char **dest, const char *str, size_t n) { - /* Clamp n to the string length */ - size_t str_length = strlen(str); - if (str_length < n) - n = str_length; - - return cat(dest, str, n); + return cat(dest, str, strnlen(str, n)); } char * |