#include "names.h"
#ifndef lint
-FILE_RCSID("@(#)$Id: ascmagic.c,v 1.44 2006/03/02 22:08:22 christos Exp $")
+FILE_RCSID("@(#)$Id: ascmagic.c,v 1.45 2006/03/12 22:09:33 christos Exp $")
#endif /* lint */
typedef unsigned long unichar;
}
}
- if (nbytes <= 1)
+ if (nbytes <= 1) {
+ rv = 0;
goto done;
+ }
/*
* for troff, look for . + letter + letter or .\";
#ifndef lint
-FILE_RCSID("@(#)$Id: softmagic.c,v 1.77 2005/10/20 14:59:01 christos Exp $")
+FILE_RCSID("@(#)$Id: softmagic.c,v 1.78 2006/03/12 22:09:33 christos Exp $")
#endif /* lint */
private int match(struct magic_set *, struct magic *, uint32_t,
* (starting at 1), not as bytes-from start-of-file
*/
char *b, *c, *last = NULL;
+ if (s == NULL) {
+ p->search.buflen = 0;
+ p->search.buf = NULL;
+ return 0;
+ }
if ((p->search.buf = strdup((const char *)s)) == NULL) {
file_oomem(ms);
return -1;