changeset 30751:a375d947381b

Use negative return values for errors in pls_read_entry to make it match with the checks later on.
author reimar
date Sun, 28 Feb 2010 09:41:07 +0000
parents b9ec8956164f
children abec4bb780e5
files playtreeparser.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/playtreeparser.c	Sun Feb 28 09:39:30 2010 +0000
+++ b/playtreeparser.c	Sun Feb 28 09:41:07 2010 +0000
@@ -252,14 +252,14 @@
   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 @@
   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;
   }