From: deraadt Date: Mon, 16 Dec 1996 15:09:45 +0000 (+0000) Subject: stncat misuse X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f5c716373be2eaef899986d512d8b5e472411132;p=openbsd stncat misuse --- diff --git a/lib/libedit/el.c b/lib/libedit/el.c index 6a71eb82b05..6b7b5d49bc4 100644 --- a/lib/libedit/el.c +++ b/lib/libedit/el.c @@ -294,8 +294,8 @@ el_source(el, fname) if (issetugid() != 0 || (ptr = getenv("HOME")) == NULL) return -1; fname = strncpy(path, ptr, MAXPATHLEN); - (void) strncat(path, elpath, MAXPATHLEN); path[MAXPATHLEN-1] = '\0'; + (void) strncat(path, elpath, MAXPATHLEN - strlen(path)); } }