[MPlayer-cvslog] r36248 - trunk/input/input.c

reimar subversion at mplayerhq.hu
Tue May 7 22:39:17 CEST 2013


Author: reimar
Date: Tue May  7 22:39:17 2013
New Revision: 36248

Log:
Make 0 termination code more robust against future changes.

Modified:
   trunk/input/input.c

Modified: trunk/input/input.c
==============================================================================
--- trunk/input/input.c	Tue May  7 22:39:16 2013	(r36247)
+++ trunk/input/input.c	Tue May  7 22:39:17 2013	(r36248)
@@ -1608,6 +1608,8 @@ mp_input_parse_config(char *file) {
     int bs = strlen(buffer);
     if(! eof && bs < BS_MAX-1) {
       int r = read(fd,buffer+bs,BS_MAX-1-bs);
+      if (r > 0) bs += r;
+      buffer[bs] = 0;
       if(r < 0) {
 	if(errno == EINTR)
 	  continue;
@@ -1616,8 +1618,6 @@ mp_input_parse_config(char *file) {
 	return 0;
       }
       eof = r == 0;
-      bs += r;
-      buffer[bs] = 0;
     }
     // Empty buffer : return
     if(!buffer[0]) {


More information about the MPlayer-cvslog mailing list