Skip to content
Permalink
Browse files
PR/256: mutableVoid: If the file is less than 3 bytes, use the file l…
…ength

to determine type
  • Loading branch information
zoulasc committed Apr 19, 2021
1 parent 9b0459a commit 749e1ecfc3d333e5ec8b1a2e639da7ccb2498c34
Showing 1 changed file with 2 additions and 2 deletions.
@@ -35,7 +35,7 @@
#include "file.h"

#ifndef lint
FILE_RCSID("@(#)$File: encoding.c,v 1.30 2021/04/09 19:16:51 christos Exp $")
FILE_RCSID("@(#)$File: encoding.c,v 1.31 2021/04/19 18:38:04 christos Exp $")
#endif /* lint */

#include "magic.h"
@@ -285,7 +285,7 @@ looks_ ## NAME(const unsigned char *buf, size_t nbytes, file_unichar_t *ubuf, \
if (dist[i]) \
u++; \
} \
if (u < 3) \
if (u < MIN(nbytes, 3)) \
return 0; \
\
return 1; \

0 comments on commit 749e1ec

Please sign in to comment.