]> Dogcows Code - chaz/tar/commitdiff
(decode_record): Reversed the return condition.
authorSergey Poznyakoff <gray@gnu.org.ua>
Thu, 4 Sep 2003 09:37:48 +0000 (09:37 +0000)
committerSergey Poznyakoff <gray@gnu.org.ua>
Thu, 4 Sep 2003 09:37:48 +0000 (09:37 +0000)
src/xheader.c

index 6f8c140b12cdd229b8551ca26a4386893f906534..3926a7f81ad2601437cec8afe6dbc9a1e1653786 100644 (file)
@@ -51,6 +51,9 @@ locate_handler (char const *keyword)
   return NULL;
 }
 
+/* Decodes a single extended header record. Advances P to the next
+   record.
+   Returns true on success, false otherwise. */
 static bool
 decode_record (char **p, struct tar_stat_info *st)
 {
@@ -61,13 +64,13 @@ decode_record (char **p, struct tar_stat_info *st)
   struct xhdr_tab const *t;
 
   if (**p == 0)
-    return true;
+    return false;
 
   len = strtoul (*p, p, 10);
   if (**p != ' ')
     {
-      ERROR ((0, 0, _("Malformed extended header")));
-      return true;
+      ERROR ((0, 0, _("Malformed extended header: missing whitespace after the length")));
+      return false;
     }
 
   keyword = ++*p;
@@ -77,8 +80,8 @@ decode_record (char **p, struct tar_stat_info *st)
 
   if (**p != '=')
     {
-      ERROR ((0, 0, _("Malformed extended header")));
-      return true;
+      ERROR ((0, 0, _("Malformed extended header: missing equal sign")));
+      return false;
     }
 
   eqp = *p;
@@ -98,7 +101,7 @@ decode_record (char **p, struct tar_stat_info *st)
     }
   *eqp = '=';
   *p = &start[len];
-  return false;
+  return true;
 }
 
 void
@@ -108,7 +111,7 @@ xheader_decode (struct tar_stat_info *st)
   char *endp = &extended_header.buffer[extended_header.size-1];
 
   while (p < endp)
-    if (decode_record (&p, st))
+    if (!decode_record (&p, st))
       break;
 }
 
This page took 0.029941 seconds and 4 git commands to generate.