]> granicus.if.org Git - file/commitdiff
str_flags and num_mask are the same bytes in the union, so don't erroneously
authorChristos Zoulas <christos@zoulas.com>
Tue, 15 Mar 2011 22:15:30 +0000 (22:15 +0000)
committerChristos Zoulas <christos@zoulas.com>
Tue, 15 Mar 2011 22:15:30 +0000 (22:15 +0000)
try to figure out if a test should be binary for non string types. PR/116.
This affected tga file magic where the mask is 0xffffff and the binary test
turned to ascii.

src/apprentice.c

index ed16939ccee7a1bfbec24b7790716874871c42d8..02f87c128d02c3470828b6c1792e4de2a3f8a028 100644 (file)
@@ -32,7 +32,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: apprentice.c,v 1.165 2011/01/16 19:30:36 rrt Exp $")
+FILE_RCSID("@(#)$File: apprentice.c,v 1.166 2011/02/24 03:35:59 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -624,6 +624,8 @@ set_test_type(struct magic *mstart, struct magic *m)
        case FILE_DOUBLE:
        case FILE_BEDOUBLE:
        case FILE_LEDOUBLE:
+               mstart->flag |= BINTEST;
+               break;
        case FILE_STRING:
        case FILE_PSTRING:
        case FILE_BESTRING16: