Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/lpr/common_source use strlcpy. from openbsd



details:   https://anonhg.NetBSD.org/src/rev/4891264a1a3d
branches:  trunk
changeset: 514327:4891264a1a3d
user:      itojun <itojun%NetBSD.org@localhost>
date:      Thu Aug 30 00:53:53 2001 +0000

description:
use strlcpy.  from openbsd

diffstat:

 usr.sbin/lpr/common_source/displayq.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r e9378876594c -r 4891264a1a3d usr.sbin/lpr/common_source/displayq.c
--- a/usr.sbin/lpr/common_source/displayq.c     Thu Aug 30 00:51:50 2001 +0000
+++ b/usr.sbin/lpr/common_source/displayq.c     Thu Aug 30 00:53:53 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: displayq.c,v 1.21 2001/08/30 00:51:50 itojun Exp $     */
+/*     $NetBSD: displayq.c,v 1.22 2001/08/30 00:53:53 itojun Exp $     */
 
 /*
  * Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)displayq.c 8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: displayq.c,v 1.21 2001/08/30 00:51:50 itojun Exp $");
+__RCSID("$NetBSD: displayq.c,v 1.22 2001/08/30 00:53:53 itojun Exp $");
 #endif
 #endif /* not lint */
 
@@ -366,8 +366,7 @@
                        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;



Home | Main Index | Thread Index | Old Index