projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
85dfab7
)
fix processing of strptime %p format
author
Julien Ramseier
<j.ramseier@gmail.com>
Tue, 21 Mar 2017 16:30:45 +0000
(12:30 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Tue, 21 Mar 2017 16:30:45 +0000
(12:30 -0400)
string pointer was not advanced after matching.
src/time/strptime.c
patch
|
blob
|
history
diff --git
a/src/time/strptime.c
b/src/time/strptime.c
index da9e1f42c3c932a5dc4ea08b9ac2fa3bc403e2f5..cff0a7c11a767a3b30a29dc0c294bb193a6df3de 100644
(file)
--- a/
src/time/strptime.c
+++ b/
src/time/strptime.c
@@
-94,6
+94,7
@@
char *strptime(const char *restrict s, const char *restrict f, struct tm *restri
len = strlen(ex);
if (!strncasecmp(s, ex, len)) {
tm->tm_hour %= 12;
+ s += len;
break;
}
ex = nl_langinfo(PM_STR);
@@
-101,6
+102,7
@@
char *strptime(const char *restrict s, const char *restrict f, struct tm *restri
if (!strncasecmp(s, ex, len)) {
tm->tm_hour %= 12;
tm->tm_hour += 12;
+ s += len;
break;
}
return 0;