Skip to content
Permalink
Browse files Browse the repository at this point in the history
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 749e1ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/encoding.c
Expand Up @@ -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"
Expand Down Expand Up @@ -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; \
Expand Down

0 comments on commit 749e1ec

Please sign in to comment.