0233e9
diff --git a/src/softmagic.c b/src/softmagic.c
0233e9
index 8d08cad..6dc86f5 100644
0233e9
--- a/src/softmagic.c
0233e9
+++ b/src/softmagic.c
0233e9
@@ -41,8 +41,6 @@ FILE_RCSID("@(#)$File: softmagic.c,v 1.147 2011/11/05 15:44:22 rrt Exp $")
0233e9
 #include <stdlib.h>
0233e9
 #include <time.h>
0233e9
 
0233e9
-#define OFFSET_OOB(n, o, i)  ((n) < (o) || (i) >= ((n) - (o)))
0233e9
-
0233e9
 private int match(struct magic_set *, struct magic *, uint32_t,
0233e9
     const unsigned char *, size_t, int, int, int);
0233e9
 private int mget(struct magic_set *, const unsigned char *,
83d9a8
@@ -1601,7 +1599,7 @@ mget(struct magic_set *ms, const unsigned char *s,
0233e9
 		break;
0233e9
 
0233e9
 	case FILE_REGEX:
0233e9
-		if (OFFSET_OOB(nbytes, offset, 0))
0233e9
+		if (nbytes < offset)
0233e9
 			return 0;
0233e9
 		break;
0233e9
 
83d9a8
@@ -1611,7 +1609,7 @@ mget(struct magic_set *ms, const unsigned char *s,
0233e9
 			return -1;
0233e9
 		if (offset == 0)
0233e9
 			return 0;
0233e9
-		if (OFFSET_OOB(nbytes, offset, 0))
0233e9
+		if (nbytes < offset)
0233e9
  			return 0;
0233e9
 		return file_softmagic(ms, s + offset, nbytes - offset,
0233e9
 		    recursion_level, BINTEST, text);