mirror of
https://github.com/openbsd/src.git
synced 2026-04-24 14:14:37 +00:00
in hhmm mode, check that len(time) is 4 to avoid confusion.
feedback cheloha deraadt
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: leave.c,v 1.19 2018/02/10 00:00:47 tb Exp $ */
|
||||
/* $OpenBSD: leave.c,v 1.20 2020/01/27 01:05:28 tedu Exp $ */
|
||||
/* $NetBSD: leave.c,v 1.4 1995/07/03 16:50:13 phil Exp $ */
|
||||
|
||||
/*
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <err.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static __dead void usage(void);
|
||||
@@ -84,6 +85,9 @@ main(int argc, char *argv[])
|
||||
++cp;
|
||||
}
|
||||
|
||||
if (!plusnow && strlen(cp) != 4)
|
||||
usage();
|
||||
|
||||
for (hours = 0; (c = *cp) && c != '\n'; ++cp) {
|
||||
if (!isdigit((unsigned char)c))
|
||||
usage();
|
||||
|
||||
Reference in New Issue
Block a user