mirror of
https://github.com/opnsense/src.git
synced 2026-04-21 06:07:31 -04:00
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
2e1b1231fc
commit
427fc5ed6f
1 changed files with 16 additions and 0 deletions
|
|
@ -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…
Reference in a new issue