Download raw body.
replace 2 last instances of strncpy with strlcpy
I would also like to propose this minor diff.
BR
Han
diff --git a/extend.c b/extend.c
index 154ff30..1048c0b 100644
--- a/extend.c
+++ b/extend.c
@@ -600,10 +600,8 @@ evalbuffer(int f, int n)
llen = llength(lp);
if (llen >= BUFSIZE)
return (FALSE);
- (void)strncpy(excbuf, ltext(lp), llen);
+ (void)strlcpy(excbuf, ltext(lp), llen + 1);
- /* make sure the line is terminated */
- excbuf[llen] = '\0';
if ((s = excline(excbuf, llen, lnum)) != TRUE) {
cleanup();
return (s);
diff --git a/tags.c b/tags.c
index c470acf..b1d623a 100644
--- a/tags.c
+++ b/tags.c
@@ -473,8 +473,7 @@ curtoken(int f, int n, char *token)
r = FALSE;
goto cleanup;
}
- strncpy(token, ltext(curwp->w_dotp) + tdoto, size);
- token[size] = '\0';
+ strlcpy(token, ltext(curwp->w_dotp) + tdoto, size + 1);
r = TRUE;
cleanup:
replace 2 last instances of strncpy with strlcpy