diff aviobuf.c @ 6300:e62d23b0547d libavformat

move ff_get_line to aviobuf.c
author aurel
date Wed, 21 Jul 2010 21:39:01 +0000
parents 0969c3bcb267
children 1b2b5dbcf549
line wrap: on
line diff
--- a/aviobuf.c	Wed Jul 21 21:35:44 2010 +0000
+++ b/aviobuf.c	Wed Jul 21 21:39:01 2010 +0000
@@ -554,6 +554,20 @@
     return buf;
 }
 
+void ff_get_line(ByteIOContext *s, char *buf, int maxlen)
+{
+    int i = 0;
+    char c;
+
+    do {
+        c = get_byte(s);
+        if (i < maxlen-1)
+            buf[i++] = c;
+    } while (c != '\n' && c);
+
+    buf[i] = 0;
+}
+
 uint64_t get_be64(ByteIOContext *s)
 {
     uint64_t val;