Avoid ambigious if/else

This commit is contained in:
Bill Fumerola 1999-07-21 02:49:42 +00:00
parent 3bdaa8d82e
commit c1160fe492
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=48956
2 changed files with 6 additions and 4 deletions

View File

@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)shutdown.c 8.4 (Berkeley) 4/28/95";
#endif
static const char rcsid[] =
"$Id: shutdown.c,v 1.18 1999/06/21 06:21:05 jkoshy Exp $";
"$Id: shutdown.c,v 1.19 1999/06/21 16:06:21 ru Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -420,7 +420,7 @@ getoffset(timearg)
/* handle hh:mm by getting rid of the colon */
for (p = timearg; *p; ++p)
if (!isascii(*p) || !isdigit(*p))
if (!isascii(*p) || !isdigit(*p)) {
if (*p == ':' && strlen(p) == 3) {
p[0] = p[1];
p[1] = p[2];
@ -428,6 +428,7 @@ getoffset(timearg)
}
else
badtime();
}
unsetenv("TZ"); /* OUR timezone */
lt = localtime(&now); /* current time val */

View File

@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)from: sysctl.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
"$Id: sysctl.c,v 1.19 1998/11/08 19:27:43 phk Exp $";
"$Id: sysctl.c,v 1.20 1999/01/10 02:10:08 des Exp $";
#endif /* not lint */
#include <sys/types.h>
@ -477,11 +477,12 @@ sysctl_all (int *oid, int len)
while (1) {
l2 = sizeof name2;
j = sysctl(name1, l1, name2, &l2, 0, 0);
if (j < 0)
if (j < 0) {
if (errno == ENOENT)
return 0;
else
err(1, "sysctl(getnext) %d %d", j, l2);
}
l2 /= sizeof (int);