Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/lib/libc/time Pull up revision 1.12 (requested by groo):
details: https://anonhg.NetBSD.org/src/rev/86d29e01e0b0
branches: netbsd-1-5
changeset: 493071:86d29e01e0b0
user: he <he%NetBSD.org@localhost>
date: Wed Apr 17 12:15:27 2002 +0000
description:
Pull up revision 1.12 (requested by groo):
Replace strncpy() with strlcpy().
diffstat:
lib/libc/time/zdump.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diffs (47 lines):
diff -r 3ad5dcc3435c -r 86d29e01e0b0 lib/libc/time/zdump.c
--- a/lib/libc/time/zdump.c Wed Apr 17 12:14:43 2002 +0000
+++ b/lib/libc/time/zdump.c Wed Apr 17 12:15:27 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zdump.c,v 1.10 1999/02/08 18:00:19 kleink Exp $ */
+/* $NetBSD: zdump.c,v 1.10.10.1 2002/04/17 12:15:27 he Exp $ */
#include <sys/cdefs.h>
#ifndef lint
@@ -6,7 +6,7 @@
#if 0
static char elsieid[] = "@(#)zdump.c 7.28";
#else
-__RCSID("$NetBSD: zdump.c,v 1.10 1999/02/08 18:00:19 kleink Exp $");
+__RCSID("$NetBSD: zdump.c,v 1.10.10.1 2002/04/17 12:15:27 he Exp $");
#endif
#endif /* !defined NOID */
#endif /* !defined lint */
@@ -237,7 +237,7 @@
t += SECSPERHOUR * HOURSPERDAY;
show(argv[i], t, TRUE);
tm = *localtime(&t);
- (void) strncpy(buf, abbr(&tm), (sizeof buf) - 1);
+ (void) strlcpy(buf, abbr(&tm), (sizeof buf));
for ( ; ; ) {
if (cutoff != NULL && t >= cuttime)
break;
@@ -252,8 +252,8 @@
strcmp(abbr(&newtm), buf) != 0) {
newt = hunt(argv[i], t, newt);
newtm = *localtime(&newt);
- (void) strncpy(buf, abbr(&newtm),
- (sizeof buf) - 1);
+ (void) strlcpy(buf, abbr(&newtm),
+ (sizeof buf));
}
t = newt;
tm = newtm;
@@ -294,7 +294,7 @@
static char loab[MAX_STRING_LENGTH];
lotm = *localtime(&lot);
- (void) strncpy(loab, abbr(&lotm), (sizeof loab) - 1);
+ (void) strlcpy(loab, abbr(&lotm), (sizeof loab));
while ((hit - lot) >= 2) {
t = lot / 2 + hit / 2;
if (t <= lot)
Home |
Main Index |
Thread Index |
Old Index