diff options
| author | Warner Losh <imp@FreeBSD.org> | 1997-02-09 05:05:43 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 1997-02-09 05:05:43 +0000 |
| commit | 24f5e22778ab48cd6dbb21f99488386795ac7d05 (patch) | |
| tree | be021658fd3ac885b81f9e4064632b35e8c08f4e /usr.sbin | |
| parent | 8c96e7942d4249dbf98874308ffa6de8f91b260c (diff) | |
Notes
Diffstat (limited to 'usr.sbin')
| -rw-r--r-- | usr.sbin/lpr/lpc/cmds.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/lpr/lpc/cmds.c b/usr.sbin/lpr/lpc/cmds.c index 722e81b2de0a..51e269e5b995 100644 --- a/usr.sbin/lpr/lpc/cmds.c +++ b/usr.sbin/lpr/lpc/cmds.c @@ -329,7 +329,8 @@ cleanpr() n++; } if (n == 0) { - strcpy(lp, cp); + strncpy(lp, cp, sizeof(line) - strlen(line) - 1); + line[sizeof(line) - 1] = '\0'; unlinkf(line); } } else { @@ -338,7 +339,8 @@ cleanpr() * been skipped above) or a tf file (which can always * be removed). */ - strcpy(lp, cp); + strncpy(lp, cp, sizeof(line) - strlen(line) - 1); + line[sizeof(line) - 1] = '\0'; unlinkf(line); } } while (++i < nitems); |
