[MPlayer-cvslog] r30793 - trunk/playtreeparser.c

reimar subversion at mplayerhq.hu
Sun Feb 28 10:41:08 CET 2010


Author: reimar
Date: Sun Feb 28 10:41:07 2010
New Revision: 30793

Log:
Use negative return values for errors in pls_read_entry to make it match
with the checks later on.

Modified:
   trunk/playtreeparser.c

Modified: trunk/playtreeparser.c
==============================================================================
--- trunk/playtreeparser.c	Sun Feb 28 10:39:30 2010	(r30792)
+++ trunk/playtreeparser.c	Sun Feb 28 10:41:07 2010	(r30793)
@@ -252,14 +252,14 @@ pls_read_entry(char* line,pls_entry_t** 
   v = pls_entry_get_value(line);
   if(!v) {
     mp_msg(MSGT_PLAYTREE,MSGL_ERR,"No value in entry %s\n",line);
-    return 0;
+    return -1;
   }
 
   num = atoi(line);
   if(num <= 0 || num > limit) {
     if (max_entry >= limit) {
         mp_msg(MSGT_PLAYTREE, MSGL_WARN, "Too many index entries\n");
-        return 0;
+        return -1;
     }
     num = max_entry+1;
     mp_msg(MSGT_PLAYTREE,MSGL_WARN,"No or invalid entry index in entry %s\nAssuming %d\n",line,num);
@@ -267,7 +267,7 @@ pls_read_entry(char* line,pls_entry_t** 
   if(num > max_entry) {
     e = realloc(e, num * sizeof(pls_entry_t));
     if (!e)
-      return 0;
+      return -1;
     memset(&e[max_entry],0,(num-max_entry)*sizeof(pls_entry_t));
     max_entry = num;
   }


More information about the MPlayer-cvslog mailing list