summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristos Zoulas <christos@zoulas.com>2022-06-10 13:40:17 +0000
committerChristos Zoulas <christos@zoulas.com>2022-06-10 13:40:17 +0000
commitd9f343409198a64b027c54efe4342ac2470dafb3 (patch)
tree16513080ceac1dc219cad27bea35db1b739fcaa3
parentea49efab4db1b7f7afc98251757d33f9a3d1b09f (diff)
downloadfile-git-d9f343409198a64b027c54efe4342ac2470dafb3.tar.gz
Require BOM for UCS16 like we do for UCS32. Otherwise we get too many
false positives for UCS16.
-rw-r--r--src/encoding.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/encoding.c b/src/encoding.c
index 672481c5..e40cb62c 100644
--- a/src/encoding.c
+++ b/src/encoding.c
@@ -35,7 +35,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: encoding.c,v 1.37 2022/04/22 23:07:01 christos Exp $")
+FILE_RCSID("@(#)$File: encoding.c,v 1.38 2022/06/10 13:40:17 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -477,7 +477,7 @@ looks_ucs16(const unsigned char *bf, size_t nbytes, file_unichar_t *ubf,
else if (bf[0] == 0xfe && bf[1] == 0xff)
bigend = 1;
else
- bigend = 1;
+ return 0;
*ulen = 0;
hi = 0;