提交 834ef7af 编写于 作者: J Julien Ramseier 提交者: Rich Felker

fix processing of strptime %p format

string pointer was not advanced after matching.
上级 85dfab7e
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册