diff options
author | melifaro <melifaro@FreeBSD.org> | 2014-10-09 15:35:28 +0000 |
---|---|---|
committer | melifaro <melifaro@FreeBSD.org> | 2014-10-09 15:35:28 +0000 |
commit | d23efba7dd470e247cbcacf9ec6cf642d02d5b8c (patch) | |
tree | 6d2822f6a5ff6c5c487b859a557d076b53b03c46 /lib/libc/stdtime/strptime.c | |
parent | cab1d703b61e2216f130c6d1a23ca70b2b322386 (diff) | |
parent | c47600c4ec062b8225ac1d48197a2a1de778760d (diff) | |
download | FreeBSD-src-d23efba7dd470e247cbcacf9ec6cf642d02d5b8c.zip FreeBSD-src-d23efba7dd470e247cbcacf9ec6cf642d02d5b8c.tar.gz |
Sync to HEAD@r272825.
Diffstat (limited to 'lib/libc/stdtime/strptime.c')
-rw-r--r-- | lib/libc/stdtime/strptime.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/libc/stdtime/strptime.c b/lib/libc/stdtime/strptime.c index 55c9960..2be6358 100644 --- a/lib/libc/stdtime/strptime.c +++ b/lib/libc/stdtime/strptime.c @@ -103,9 +103,6 @@ _strptime(const char *buf, const char *fmt, struct tm *tm, int *GMTp, ptr = fmt; while (*ptr != 0) { - if (*buf == 0) - break; - c = *ptr++; if (c != '%') { @@ -123,7 +120,6 @@ _strptime(const char *buf, const char *fmt, struct tm *tm, int *GMTp, label: c = *ptr++; switch (c) { - case 0: case '%': if (*buf++ != '%') return (NULL); @@ -600,6 +596,9 @@ label: while (isspace_l((unsigned char)*buf, locale)) buf++; break; + + default: + return (NULL); } } @@ -676,8 +675,6 @@ strptime_l(const char * __restrict buf, const char * __restrict fmt, if (ret && gmt) { time_t t = timegm(tm); - if (t == -1) - return (NULL); localtime_r(&t, tm); } |