Recognize the %s format.
Submitted by: Thomas Zenker <thz@lennartz-electronic.de> and Maxim Konovalov <maxim@macomnet.ru>, respectively Reviewed by: -audit
This commit is contained in:
parent
8795e3b574
commit
bd37181c76
@ -67,6 +67,8 @@ static char sccsid[] = "@(#)strptime.c 0.1 (Powerdog) 94/03/27";
|
||||
#include "namespace.h"
|
||||
#include <time.h>
|
||||
#include <ctype.h>
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <pthread.h>
|
||||
#include "un-namespace.h"
|
||||
@ -445,6 +447,20 @@ label:
|
||||
ptr++;
|
||||
break;
|
||||
|
||||
case 's':
|
||||
{
|
||||
char *cp;
|
||||
time_t t;
|
||||
|
||||
t = strtol(buf, &cp, 10);
|
||||
if (t == LONG_MAX)
|
||||
return 0;
|
||||
buf = cp;
|
||||
gmtime_r(&t, tm);
|
||||
got_GMT = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'Y':
|
||||
case 'y':
|
||||
if (*buf == 0 || isspace((unsigned char)*buf))
|
||||
|
Loading…
x
Reference in New Issue
Block a user