]> granicus.if.org Git - file/commitdiff
instead of requiring all the sections to be present, require only one of them.
authorChristos Zoulas <christos@zoulas.com>
Tue, 18 Oct 2016 16:10:07 +0000 (16:10 +0000)
committerChristos Zoulas <christos@zoulas.com>
Tue, 18 Oct 2016 16:10:07 +0000 (16:10 +0000)
src/readcdf.c

index 1b105d0657159555844de6b121bb0f3b80699872..483e1d809466515c06c2fa05d55a5ab0195d4d7a 100644 (file)
@@ -26,7 +26,7 @@
 #include "file.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$File: readcdf.c,v 1.61 2016/10/17 23:04:27 christos Exp $")
+FILE_RCSID("@(#)$File: readcdf.c,v 1.62 2016/10/18 16:10:07 christos Exp $")
 #endif
 
 #include <assert.h>
@@ -514,15 +514,13 @@ cdf_file_dir_info(struct magic_set *ms, const cdf_dir_t *dir)
                const struct sinfo *si = &sectioninfo[sd];
                for (j = 0; si->sections[j]; j++) {
                        if (cdf_find_stream(dir, si->sections[j], si->types[j])
-                           <= 0) {
+                           > 0)
+                               break;
 #ifdef CDF_DEBUG
-                               fprintf(stderr, "Can't read %s\n",
-                                   si->sections[j]);
+                       fprintf(stderr, "Can't read %s\n", si->sections[j]);
 #endif
-                               break;
-                       }
                }
-               if (si->sections[j] != NULL)
+               if (si->sections[j] == NULL)
                        continue;
                if (NOTMIME(ms)) {
                        if (file_printf(ms, "CDFV2 %s", si->name) == -1)