lavu/parseutils: fix av_small_strptime() whitespace directive parsing

According to POSIX, strptime() should consume whitespaces in the date
string everytime a whitespace conversion specification is found in the
date format specification. Make av_small_strptime() conform with this
behavior.

In particular, should fix trac ticket .
This commit is contained in:
Stefano Sabatini 2012-09-16 15:22:31 +02:00
parent 83438a0db3
commit 85c93d90df
2 changed files with 7 additions and 1 deletions
libavutil

View file

@ -443,6 +443,12 @@ char *av_small_strptime(const char *p, const char *fmt, struct tm *dt)
int c, val;
for(;;) {
/* consume time string until a non whitespace char is found */
while (isspace(*fmt)) {
while (isspace(*p))
p++;
fmt++;
}
c = *fmt++;
if (c == '\0') {
return (char *)p;