summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlebel <lebel@cvs.openbsd.org>2001-06-22 14:26:37 +0000
committerlebel <lebel@cvs.openbsd.org>2001-06-22 14:26:37 +0000
commitcd65ba11166aadcf84cf8c227662024ae1126d75 (patch)
treec3569ffe11b082b739edc77334e05ddefdf9cc4a
parent0feae2b086084ce16940249793f7b5ecabe85c52 (diff)
use strlcpy vs strncpy+a[len-1]='\0'
-rw-r--r--usr.bin/cdio/cdio.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/cdio/cdio.c b/usr.bin/cdio/cdio.c
index 36541f48609..1326e5b7964 100644
--- a/usr.bin/cdio/cdio.c
+++ b/usr.bin/cdio/cdio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cdio.c,v 1.15 2000/12/24 11:35:42 aaron Exp $ */
+/* $OpenBSD: cdio.c,v 1.16 2001/06/22 14:26:36 lebel Exp $ */
/*
* Compact Disc Control Utility by Serge V. Vakulenko <vak@cronyx.ru>.
* Based on the non-X based CD player by Jean-Marc Zucconi and
@@ -324,8 +324,7 @@ int run (cmd, arg)
/* open new device */
if (!open_cd (arg))
return (0);
- (void) strncpy(newcdname, arg, sizeof(newcdname) - 1);
- newcdname[sizeof(newcdname) - 1] = '\0';
+ (void) strlcpy(newcdname, arg, sizeof(newcdname));
cdname = newcdname;
return (1);