mirror of
https://github.com/freebsd/freebsd-src
synced 2024-11-05 18:22:52 +00:00
Fix date parsing to allow '0' (none) date value.
This commit is contained in:
parent
3e626fb3c1
commit
2bffe0d58e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=44775
1 changed files with 2 additions and 3 deletions
|
@ -26,7 +26,7 @@
|
|||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"$Id$";
|
||||
"$Id: psdate.c,v 1.4 1997/10/10 06:23:32 charnier Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -180,8 +180,7 @@ parse_date(time_t dt, char const * str)
|
|||
++str;
|
||||
|
||||
if (numerics(str)) {
|
||||
val = strtol(str, &p, 0);
|
||||
dt = val ? val : dt;
|
||||
dt = strtol(str, &p, 0);
|
||||
} else if (*str == '+' || *str == '-') {
|
||||
val = strtol(str, &p, 0);
|
||||
switch (*p) {
|
||||
|
|
Loading…
Reference in a new issue