summaryrefslogtreecommitdiff
path: root/lib/libedit
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>1997-03-23 23:17:22 +0000
committerWarner Losh <imp@FreeBSD.org>1997-03-23 23:17:22 +0000
commitd1942b2e762bb5c734df2135e0669f14759fa624 (patch)
tree37c69963422bf9d7eb53ade944f26142f6fed429 /lib/libedit
parent92936d823feb01eb18f993a4377ca8597769403b (diff)
Notes
Diffstat (limited to 'lib/libedit')
-rw-r--r--lib/libedit/el.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libedit/el.c b/lib/libedit/el.c
index 075a05357a26..305a51df28de 100644
--- a/lib/libedit/el.c
+++ b/lib/libedit/el.c
@@ -293,9 +293,8 @@ el_source(el, fname)
if ((fp = fopen(fname, "r")) == NULL) {
if ((ptr = getenv("HOME")) == NULL)
return -1;
- fname = strncpy(path, ptr, MAXPATHLEN);
- (void) strncat(path, elpath, MAXPATHLEN);
- path[MAXPATHLEN-1] = '\0';
+ (void)snprintf(path, sizeof(path), "%s%s", ptr, elpath);
+ fname = path;
}
}