perl -e 'print "\x0" x 8, "bad", "\x0" x 1013, "H+", "\x0" x 6, "good"' | ./file
printing bad...
Reset the continuation offset. From Christoph Biedl
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: softmagic.c,v 1.209 2015/01/05 20:05:39 christos Exp $")
+FILE_RCSID("@(#)$File: softmagic.c,v 1.210 2015/01/05 20:21:30 christos Exp $")
#endif /* lint */
#include "magic.h"
if ((ms->flags & MAGIC_CONTINUE) == 0 && *printed_something) {
return *returnval; /* don't keep searching */
}
+ cont_level = 0;
}
return *returnval; /* This is hit if -k is set or there is no match */
}