Remove unnecesary local changes. The strncpy()'s are safe because
authormillert <millert@openbsd.org>
Tue, 21 Jan 1997 04:52:44 +0000 (04:52 +0000)
committermillert <millert@openbsd.org>
Tue, 21 Jan 1997 04:52:44 +0000 (04:52 +0000)
the string is static and so the last element is always init'd to
zero.

lib/libc/time/localtime.c
lib/libc/time/zdump.c

index a7cdae4..5546e0e 100644 (file)
@@ -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, "/");
index 2df4b3e..bf71ad5 100644 (file)
@@ -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;