summaryrefslogtreecommitdiffstats
path: root/contrib/file/ascmagic.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2003-02-15 18:53:17 +0000
committerobrien <obrien@FreeBSD.org>2003-02-15 18:53:17 +0000
commit822cce384d16c9a63f80e0c0765717d4a329368d (patch)
tree8ac609acaed8017450269720d947a6a7bd69e3ea /contrib/file/ascmagic.c
parent2ef757c3c642f5ce8353e106c1fbbd3cea2b14c1 (diff)
downloadFreeBSD-src-822cce384d16c9a63f80e0c0765717d4a329368d.zip
FreeBSD-src-822cce384d16c9a63f80e0c0765717d4a329368d.tar.gz
Virgin import of Christos Zoulas's FILE 3.40.
Diffstat (limited to 'contrib/file/ascmagic.c')
-rw-r--r--contrib/file/ascmagic.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/file/ascmagic.c b/contrib/file/ascmagic.c
index cbbcbe8..8217f19 100644
--- a/contrib/file/ascmagic.c
+++ b/contrib/file/ascmagic.c
@@ -45,7 +45,7 @@
#include "names.h"
#ifndef lint
-FILE_RCSID("@(#)$Id: ascmagic.c,v 1.32 2002/07/03 18:26:37 christos Exp $")
+FILE_RCSID("@(#)$Id: ascmagic.c,v 1.33 2003/02/08 18:33:53 christos Exp $")
#endif /* lint */
typedef unsigned long unichar;
@@ -67,7 +67,7 @@ int
ascmagic(unsigned char *buf, int nbytes)
{
int i;
- char nbuf[HOWMANY+1]; /* one extra for terminating '\0' */
+ unsigned char nbuf[HOWMANY+1]; /* one extra for terminating '\0' */
unichar ubuf[HOWMANY+1]; /* one extra for terminating '\0' */
int ulen;
struct names *p;
@@ -211,7 +211,8 @@ ascmagic(unsigned char *buf, int nbytes)
* compare the word thus isolated against the token list
*/
for (p = names; p < names + NNAMES; p++) {
- if (ascmatch(p->name, ubuf + i, end - i)) {
+ if (ascmatch((unsigned char *)p->name, ubuf + i,
+ end - i)) {
subtype = types[p->type].human;
subtype_mime = types[p->type].mime;
goto subtype_identified;
@@ -565,7 +566,7 @@ looks_unicode(const unsigned char *buf, int nbytes, unichar *ubuf, int *ulen)
return 0;
}
- return 1;
+ return 1 + bigend;
}
#undef F
OpenPOWER on IntegriCloud