#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: apprentice.c,v 1.251 2016/07/20 11:27:08 christos Exp $")
+FILE_RCSID("@(#)$File: apprentice.c,v 1.252 2016/09/11 13:53:02 christos Exp $")
#endif /* lint */
#include "magic.h"
{
struct mlist *ml;
- mlp->map = idx == 0 ? map : NULL;
+ mlp->map = NULL;
if ((ml = CAST(struct mlist *, malloc(sizeof(*ml)))) == NULL)
return -1;
- ml->map = NULL;
+ ml->map = idx == 0 ? map : NULL;
ml->magic = map->magic[idx];
ml->nmagic = map->nmagic[idx];
case MAP_TYPE_MALLOC:
for (i = 0; i < MAGIC_SETS; i++) {
if ((char *)map->magic[i] >= (char *)map->p &&
- (char *)map->magic[i] < (char *)map->p + map->len)
+ (char *)map->magic[i] <= (char *)map->p + map->len)
continue;
free(map->magic[i]);
}