Strip has constants hardwired for the minimum and maximum magic numbers. This patch moves the constants into the header. Reference: /n/sources/patch/applied/strip-consts Date: Thu Feb 10 23:35:46 CET 2005 --- /sys/include/a.out.h Thu Feb 10 23:34:28 2005 +++ /sys/include/a.out.h Thu Feb 10 23:34:25 2005 @@ -25,6 +25,8 @@ #define N_MAGIC _MAGIC(22) /* mips 4000 LE */ #define L_MAGIC _MAGIC(23) /* dec alpha */ #define P_MAGIC _MAGIC(24) /* mips 3000 LE */ +#define MIN_MAGIC 8 +#define MAX_MAGIC 24 #define DYN_MAGIC 0x80000000 /* or'd in for dynamically loaded modules */ --- /sys/src/cmd/strip.c Thu Feb 10 23:34:46 2005 +++ /sys/src/cmd/strip.c Thu Feb 10 23:34:42 2005 @@ -54,10 +54,10 @@ return 1; } i = ben(exec.magic); - for (j = 8; j < 24; j++) + for (j = MIN_MAGIC; j <= MAX_MAGIC; j++) if (i == _MAGIC(j)) break; - if (j >= 24) { + if (j > MAX_MAGIC) { fprint(2, "strip: not a recognizable binary\n"); return 1; } @@ -129,10 +129,10 @@ return 1; } i = ben(exec.magic); - for (j = 8; j < 24; j++) + for (j = MIN_MAGIC; j <= MAX_MAGIC; j++) if (i == _MAGIC(j)) break; - if (j >= 24) { + if (j > MAX_MAGIC) { fprint(2, "strip: %s is not a recognizable binary\n", file); close(fd); free(d);