BSD 4 release
[unix-history] / usr / src / cmd / 1kfix.c
index c70873c..64a471c 100644 (file)
@@ -1,3 +1,4 @@
+static char *sccsid = "@(#)1kfix.c     4.1 (Berkeley) 10/15/80";
 #include <stdio.h>
 #include <a.out.h>
 #include <sys/param.h>
 #include <stdio.h>
 #include <a.out.h>
 #include <sys/param.h>
@@ -33,15 +34,15 @@ main(argc, argv)
 
                switch (x.a_magic) {
 
 
                switch (x.a_magic) {
 
-               case 0407:
-               case 0410:
+               case OMAGIC:
+               case NMAGIC:
                        if ((round(x.a_text,NBPG) & CLOFSET) == 0) {
                                fprintf(stderr, "%s: wins as is\n", argv[0]);
                                goto skip;
                        }
                        break;
 
                        if ((round(x.a_text,NBPG) & CLOFSET) == 0) {
                                fprintf(stderr, "%s: wins as is\n", argv[0]);
                                goto skip;
                        }
                        break;
 
-               case 0413:
+               case ZMAGIC:
                        lseek(io, NBPG, 0);
                        break;
 
                        lseek(io, NBPG, 0);
                        break;
 
@@ -70,7 +71,7 @@ format:
                y = x;
                switch (x.a_magic) {
 
                y = x;
                switch (x.a_magic) {
 
-               case 0413: {
+               case ZMAGIC: {
                        int i;
                        for (i = 0; i < 512; i++)
                                if (tp[i] != 0)
                        int i;
                        for (i = 0; i < 512; i++)
                                if (tp[i] != 0)
@@ -84,8 +85,8 @@ format:
                        }
                        break;
 
                        }
                        break;
 
-               case 0407:
-               case 0410:
+               case OMAGIC:
+               case NMAGIC:
                        y.a_text = round(x.a_text, NBPG) - NBPG;
                        y.a_data += NBPG;
                        if (y.a_text == 0) {
                        y.a_text = round(x.a_text, NBPG) - NBPG;
                        y.a_data += NBPG;
                        if (y.a_text == 0) {
@@ -95,10 +96,10 @@ format:
                }
                y.a_trsize = y.a_drsize = 0;
                write(io, (char *)&y, sizeof y);
                }
                y.a_trsize = y.a_drsize = 0;
                write(io, (char *)&y, sizeof y);
-               if (x.a_magic == 0413)
+               if (x.a_magic == ZMAGIC)
                        lseek(io, BSIZE, 0);
                write(io, tp, x.a_text);
                        lseek(io, BSIZE, 0);
                write(io, tp, x.a_text);
-               if (x.a_magic != 0413)
+               if (x.a_magic != ZMAGIC)
                        write(io, zeroes, round(x.a_text, NBPG) - x.a_text);
                write(io, dp, x.a_data);
                write(io, sp, x.a_syms);
                        write(io, zeroes, round(x.a_text, NBPG) - x.a_text);
                write(io, dp, x.a_data);
                write(io, sp, x.a_syms);