summaryrefslogtreecommitdiff
path: root/src/lib/evil/evil_string.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/evil/evil_string.c')
-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 @@
18char * 18char *
19strndup(const char *str, size_t n) 19strndup(const char *str, size_t n)
20{ 20{
21 size_t slen = strlen(str); 21 size_t slen = strnlen(str, n);
22 char *ret; 22 char *ret;
23 23
24 if (slen > n) slen = n;
25 ret = malloc (slen + 1); 24 ret = malloc (slen + 1);
26 if (!ret) return NULL; 25 if (!ret) return NULL;
27 26