aboutsummaryrefslogtreecommitdiff
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
-rw-r--r--parsing.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/parsing.c b/parsing.c
index e224564..12453c2 100644
--- a/parsing.c
+++ b/parsing.c
@@ -63,7 +63,8 @@ static char *substr(const char *head, const char *tail)
if (tail < head)
return xstrdup("");
buf = xmalloc(tail - head + 1);
- strlcpy(buf, head, tail - head + 1);
+ strncpy(buf, head, tail - head);
+ buf[tail - head] = '\0';
return buf;
}