diff options
| author | Warner Losh <imp@FreeBSD.org> | 1997-03-23 23:17:22 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 1997-03-23 23:17:22 +0000 |
| commit | d1942b2e762bb5c734df2135e0669f14759fa624 (patch) | |
| tree | 37c69963422bf9d7eb53ade944f26142f6fed429 /lib/libedit | |
| parent | 92936d823feb01eb18f993a4377ca8597769403b (diff) | |
Notes
Diffstat (limited to 'lib/libedit')
| -rw-r--r-- | lib/libedit/el.c | 5 |
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; } } |
