diff options
author | 2001-06-22 15:27:19 +0000 | |
---|---|---|
committer | 2001-06-22 15:27:19 +0000 | |
commit | ba1e0c7ac5832b1dc69b0802918f30c2179c9bb2 (patch) | |
tree | ca2d44aa7cfd6f6b36ec6b697f19f63dff2f63c6 /usr.sbin/lpr/common_source/displayq.c | |
parent | make it so that audio device creation is consistent with other archs. (diff) | |
download | wireguard-openbsd-ba1e0c7ac5832b1dc69b0802918f30c2179c9bb2.tar.xz wireguard-openbsd-ba1e0c7ac5832b1dc69b0802918f30c2179c9bb2.zip |
use strlcpy vs strncpy+a[len-1]='\0'
Diffstat (limited to 'usr.sbin/lpr/common_source/displayq.c')
-rw-r--r-- | usr.sbin/lpr/common_source/displayq.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.sbin/lpr/common_source/displayq.c b/usr.sbin/lpr/common_source/displayq.c index efb9301f554..6524a759d39 100644 --- a/usr.sbin/lpr/common_source/displayq.c +++ b/usr.sbin/lpr/common_source/displayq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: displayq.c,v 1.10 1998/06/23 22:40:34 millert Exp $ */ +/* $OpenBSD: displayq.c,v 1.11 2001/06/22 15:27:19 lebel Exp $ */ /* * Copyright (c) 1983, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)displayq.c 8.4 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: displayq.c,v 1.10 1998/06/23 22:40:34 millert Exp $"; +static char rcsid[] = "$OpenBSD: displayq.c,v 1.11 2001/06/22 15:27:19 lebel Exp $"; #endif #endif /* not lint */ @@ -340,8 +340,7 @@ inform(cf) if (line[0] < 'a' || line[0] > 'z') continue; if (j == 0 || strcmp(file, line+1) != 0) { - (void) strncpy(file, line+1, sizeof(file) - 1); - file[sizeof(file) - 1] = '\0'; + (void) strlcpy(file, line+1, sizeof(file)); } j++; continue; |