summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-01-21 04:52:46 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-01-21 04:52:46 +0000
commita105d75f399cc3c12a694ee5068e075d04ba8369 (patch)
treede3a6bf1698eedcc0b397efaabfa4643d14a3e1c /lib
parentd20e5bfe50045660d14606212962161675548699 (diff)
Remove unnecesary local changes. The strncpy()'s are safe because
the string is static and so the last element is always init'd to zero.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/time/localtime.c4
-rw-r--r--lib/libc/time/zdump.c4
2 files changed, 3 insertions, 5 deletions
diff --git a/lib/libc/time/localtime.c b/lib/libc/time/localtime.c
index a7cdae4a063..5546e0e3c74 100644
--- a/lib/libc/time/localtime.c
+++ b/lib/libc/time/localtime.c
@@ -7,7 +7,7 @@
#if 0
static char elsieid[] = "@(#)localtime.c 7.59";
#else
-static char rcsid[] = "$OpenBSD: localtime.c,v 1.8 1997/01/14 03:16:47 millert Exp $";
+static char rcsid[] = "$OpenBSD: localtime.c,v 1.9 1997/01/21 04:52:44 millert Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -294,7 +294,7 @@ register struct state * const sp;
if (!doaccess && issetugid() == 0) {
if ((p = TZDIR) == NULL)
return -1;
- if ((strlen(p) + strlen(name) + 2) >= sizeof fullname)
+ if ((strlen(p) + strlen(name) + 1) >= sizeof fullname)
return -1;
(void) strcpy(fullname, p);
(void) strcat(fullname, "/");
diff --git a/lib/libc/time/zdump.c b/lib/libc/time/zdump.c
index 2df4b3e0930..bf71ad5809e 100644
--- a/lib/libc/time/zdump.c
+++ b/lib/libc/time/zdump.c
@@ -2,7 +2,7 @@
#if 0
static char elsieid[] = "@(#)zdump.c 7.24";
#else
-static char rcsid[] = "$OpenBSD: zdump.c,v 1.4 1997/01/14 03:16:56 millert Exp $";
+static char rcsid[] = "$OpenBSD: zdump.c,v 1.5 1997/01/21 04:52:45 millert Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -224,7 +224,6 @@ _("%s: usage is %s [ -v ] [ -c cutoff ] zonename ...\n"),
show(argv[i], t, TRUE);
tm = *localtime(&t);
(void) strncpy(buf, abbr(&tm), (sizeof buf) - 1);
- buf[(sizeof buf) - 1] = '\0';
for ( ; ; ) {
if (cutoff != NULL && t >= cuttime)
break;
@@ -241,7 +240,6 @@ _("%s: usage is %s [ -v ] [ -c cutoff ] zonename ...\n"),
newtm = *localtime(&newt);
(void) strncpy(buf, abbr(&newtm),
(sizeof buf) - 1);
- buf[(sizeof buf) - 1] = '\0';
}
t = newt;
tm = newtm;