diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2012-09-16 15:22:31 +0200 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2012-09-17 12:45:56 +0200 |
commit | 85c93d90dfae17d2ccff21aec5a55ca3029be83c (patch) | |
tree | 82b77fc08319c51845ba7eff8928cc845af515af /libavutil/parseutils.c | |
parent | 83438a0db3c61f06979d1c4159e5c85d52eda488 (diff) | |
download | ffmpeg-85c93d90dfae17d2ccff21aec5a55ca3029be83c.tar.gz |
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 #1739.
Diffstat (limited to 'libavutil/parseutils.c')
-rw-r--r-- | libavutil/parseutils.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c index 2440d27d64..8dc583c898 100644 --- a/libavutil/parseutils.c +++ b/libavutil/parseutils.c @@ -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; |