aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/evil/evil_string.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lib/evil/evil_string.c b/src/lib/evil/evil_string.c
index 634565b77a..4534b72437 100644
--- a/src/lib/evil/evil_string.c
+++ b/src/lib/evil/evil_string.c
@@ -18,10 +18,9 @@
char *
strndup(const char *str, size_t n)
{
- size_t slen = strlen(str);
+ size_t slen = strnlen(str, n);
char *ret;
- if (slen > n) slen = n;
ret = malloc (slen + 1);
if (!ret) return NULL;