diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2010-07-21 21:40:10 +0000 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2010-07-21 21:40:10 +0000 |
commit | a43416a54030f0cdf921ff4bd3e22bbe412ff603 (patch) | |
tree | 0edd455b27bf36cc0d7c96bd30ceb924bb84fdaf /libavformat/aviobuf.c | |
parent | 7c89295145559b269cf8e257b735386016ef1814 (diff) | |
download | ffmpeg-a43416a54030f0cdf921ff4bd3e22bbe412ff603.tar.gz |
improve ff_get_line to return line length
Originally committed as revision 24400 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/aviobuf.c')
-rw-r--r-- | libavformat/aviobuf.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 264d2def41..5841966c9b 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -554,18 +554,19 @@ char *get_strz(ByteIOContext *s, char *buf, int maxlen) return buf; } -void ff_get_line(ByteIOContext *s, char *buf, int maxlen) +int ff_get_line(ByteIOContext *s, char *buf, int maxlen) { int i = 0; char c; do { c = get_byte(s); - if (i < maxlen-1) + if (c && i < maxlen-1) buf[i++] = c; } while (c != '\n' && c); buf[i] = 0; + return i; } uint64_t get_be64(ByteIOContext *s) |