diff stream/stream.c @ 31918:3103448dcf28

Make sure we return an "empty" line on eof, to make sure we get no buffer overflows in case some code fails to check the return value.
author reimar
date Sat, 21 Aug 2010 10:08:29 +0000
parents dcd515ac5f6c
children 4614728cab25
line wrap: on
line diff
--- a/stream/stream.c	Sat Aug 21 10:07:38 2010 +0000
+++ b/stream/stream.c	Sat Aug 21 10:08:29 2010 +0000
@@ -617,7 +617,7 @@
     }
     s->buf_pos += len;
   } while(!end);
+  ptr[0] = 0;
   if(s->eof && ptr == mem) return NULL;
-  ptr[0] = 0;
   return mem;
 }