1) Fix the case we have less arguments for format string than we expected.
2) Return error on unsupported format specs. (both according to POSIX) PR: 93197
This commit is contained in:
parent
e15d3f3c09
commit
097c578c1e
@ -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 @@ _strptime(const char *buf, const char *fmt, struct tm *tm, int *GMTp,
|
||||
while (isspace_l((unsigned char)*buf, locale))
|
||||
buf++;
|
||||
break;
|
||||
|
||||
default:
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user