]> granicus.if.org Git - file/commitdiff
\fix typos
authorChristos Zoulas <christos@zoulas.com>
Wed, 15 Jan 1997 19:28:35 +0000 (19:28 +0000)
committerChristos Zoulas <christos@zoulas.com>
Wed, 15 Jan 1997 19:28:35 +0000 (19:28 +0000)
src/file.c
src/file.h
src/fsmagic.c
src/print.c
src/readelf.c
src/softmagic.c

index 22a3c442372caafba13f37f92004e10d50c90866..aa8e663f86403cc68160e4c9bca9d3a86d8e6b4a 100644 (file)
@@ -26,7 +26,7 @@
  */
 #ifndef        lint
 static char *moduleid = 
-       "@(#)$Id: file.c,v 1.37 1997/01/15 17:23:24 christos Exp $";
+       "@(#)$Id: file.c,v 1.38 1997/01/15 19:28:35 christos Exp $";
 #endif /* lint */
 
 #include <stdio.h>
@@ -79,8 +79,10 @@ int lineno;          /* line number in the magic file        */
 
 
 static void    unwrap          __P((char *fn));
+#if 0
 static int     byteconv4       __P((int, int, int));
 static short   byteconv2       __P((int, int, int));
+#endif
 
 /*
  * main - parse arguments and handle options
@@ -211,6 +213,7 @@ char *fn;
 }
 
 
+#if 0
 /*
  * byteconv4
  * Input:
@@ -273,6 +276,7 @@ byteconv2(from, same, big_endian)
   else
     return ntohs(from);                /* msb -> lsb conversion on lsb */
 }
+#endif
 
 /*
  * process - process input file
index 513ffd66d58a8a3cef6bac4501f34e0915b4f08b..c2b9654757cecf1140ec02d79289124cfd957ad9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * file.h - definitions for file(1) program
- * @(#)$Id: file.h,v 1.24 1997/01/15 17:23:24 christos Exp $
+ * @(#)$Id: file.h,v 1.25 1997/01/15 19:28:35 christos Exp $
  *
  * Copyright (c) Ian F. Darwin, 1987.
  * Written by Ian F. Darwin.
@@ -105,7 +105,8 @@ extern int   tryit          __P((unsigned char *, int, int));
 extern int   zmagic            __P((unsigned char *, int));
 extern void  ckfprintf         __P((FILE *, const char *, ...));
 extern uint32 signextend       __P((struct magic *, unsigned int32));
-
+extern int internatmagic       __P((unsigned char *, int));
+extern void tryelf             __P((int, char *, int));
 
 
 extern int errno;              /* Some unixes don't define this..      */
index b34a89a25422a6045555a5dd8e8bde5edd94e392..dab854e78d55ff5522262fcd7b8dc9fd587d7a45 100644 (file)
@@ -51,7 +51,7 @@
 
 #ifndef        lint
 static char *moduleid = 
-       "@(#)$Id: fsmagic.c,v 1.24 1996/08/20 01:51:40 christos Exp $";
+       "@(#)$Id: fsmagic.c,v 1.25 1997/01/15 19:28:35 christos Exp $";
 #endif /* lint */
 
 int
@@ -89,12 +89,12 @@ struct stat *sb;
                ckfputs("directory", stdout);
                return 1;
        case S_IFCHR:
-               (void) printf("character special (%d/%d)",
-                       major(sb->st_rdev), minor(sb->st_rdev));
+               (void) printf("character special (%ld/%ld)",
+                       (long) major(sb->st_rdev), (long) minor(sb->st_rdev));
                return 1;
        case S_IFBLK:
-               (void) printf("block special (%d/%d)",
-                       major(sb->st_rdev), minor(sb->st_rdev));
+               (void) printf("block special (%ld/%ld)",
+                       (long) major(sb->st_rdev), (long) minor(sb->st_rdev));
                return 1;
        /* TODO add code to handle V7 MUX and Blit MUX files */
 #ifdef S_IFIFO
index 17e1136a05596b2863f5199963dd03f89b293a30..15042ff3f424ec445d6e52dbce3125c9d78351f6 100644 (file)
@@ -40,7 +40,7 @@
 
 #ifndef lint
 static char *moduleid =
-       "@(#)$Id: print.c,v 1.22 1995/05/20 22:09:21 christos Exp $";
+       "@(#)$Id: print.c,v 1.23 1997/01/15 19:28:35 christos Exp $";
 #endif  /* lint */
 
 #define SZOF(a)        (sizeof(a) / sizeof(a[0]))
@@ -58,7 +58,7 @@ struct magic *m;
                       m->offset);
 
        if (m->flag & INDIR)
-               (void) fprintf(stderr, "(%s,%ld),",
+               (void) fprintf(stderr, "(%s,%d),",
                               (m->in.type >= 0 && m->in.type < SZOF(typ)) ? 
                                        typ[(unsigned char) m->in.type] :
                                        "*bad*",
@@ -69,7 +69,7 @@ struct magic *m;
                                typ[(unsigned char) m->type] : 
                                "*bad*");
        if (m->mask != ~0L)
-               (void) fprintf(stderr, " & %.8lx", m->mask);
+               (void) fprintf(stderr, " & %.8x", m->mask);
 
        (void) fprintf(stderr, ",%c", m->reln);
 
@@ -82,7 +82,7 @@ struct magic *m;
            case LELONG:
            case BESHORT:
            case BELONG:
-                   (void) fprintf(stderr, "%ld", m->value.l);
+                   (void) fprintf(stderr, "%d", m->value.l);
                    break;
            case STRING:
                    showstr(stderr, m->value.s, -1);
index 6f6f3b40f42886c522118d61e7d43f37b70c2146..a007cca3ca57cf4ec8efdeda516a3a95e39e2d4d 100644 (file)
@@ -1,6 +1,7 @@
 
 #ifdef BUILTIN_ELF
 #include <sys/types.h>
+#include <string.h>
 #include <stdio.h>
 #include <ctype.h>
 #include <stdlib.h>
@@ -236,7 +237,7 @@ tryelf(fd, buf, nbytes)
         * one is found or else the binary is stripped.
         */
        if (buf[EI_MAG0] != ELFMAG0 || buf[EI_MAG1] != ELFMAG1
-           && buf[EI_MAG2] != ELFMAG2 || buf[EI_MAG3] != ELFMAG3)
+           || buf[EI_MAG2] != ELFMAG2 || buf[EI_MAG3] != ELFMAG3)
            return;
 
 
index e79a17307d588045b65a63275d7aed382686f07e..ab621d2afe492599d3a8dc77d618b47e84726683 100644 (file)
@@ -35,7 +35,7 @@
 
 #ifndef        lint
 static char *moduleid = 
-       "@(#)$Id: softmagic.c,v 1.33 1997/01/15 17:23:24 christos Exp $";
+       "@(#)$Id: softmagic.c,v 1.34 1997/01/15 19:28:35 christos Exp $";
 #endif /* lint */
 
 static int match       __P((unsigned char *, int));
@@ -249,7 +249,8 @@ struct magic *m;
                        *rt = '\0';
                (void) printf(m->desc, pp);
                t = m->offset + sizeof(time_t);
-               return;
+               break;
+
        default:
                error("invalid m->type (%d) in mprint().\n", m->type);
                /*NOTREACHED*/
@@ -273,7 +274,6 @@ struct magic *m;
                return 1;
        case STRING:
                {
-                       size_t len;
                        char *ptr;
 
                        /* Null terminate and eat the return */
@@ -311,7 +311,7 @@ int32 offset;
 char *str;
 int len;
 {
-       (void) fprintf(stderr, "mget @%ld: ", offset);
+       (void) fprintf(stderr, "mget @%d: ", offset);
        showstr(stderr, (char *) str, len);
        (void) fputc('\n', stderr);
        (void) fputc('\n', stderr);
@@ -441,21 +441,21 @@ struct magic *m;
        switch (m->reln) {
        case 'x':
                if (debug)
-                       (void) fprintf(stderr, "%lu == *any* = 1\n", v);
+                       (void) fprintf(stderr, "%u == *any* = 1\n", v);
                matched = 1;
                break;
 
        case '!':
                matched = v != l;
                if (debug)
-                       (void) fprintf(stderr, "%lu != %lu = %d\n",
+                       (void) fprintf(stderr, "%u != %u = %d\n",
                                       v, l, matched);
                break;
 
        case '=':
                matched = v == l;
                if (debug)
-                       (void) fprintf(stderr, "%lu == %lu = %d\n",
+                       (void) fprintf(stderr, "%u == %u = %d\n",
                                       v, l, matched);
                break;
 
@@ -463,13 +463,13 @@ struct magic *m;
                if (m->flag & UNSIGNED) {
                        matched = v > l;
                        if (debug)
-                               (void) fprintf(stderr, "%lu > %lu = %d\n",
+                               (void) fprintf(stderr, "%u > %u = %d\n",
                                               v, l, matched);
                }
                else {
                        matched = (int32) v > (int32) l;
                        if (debug)
-                               (void) fprintf(stderr, "%ld > %ld = %d\n",
+                               (void) fprintf(stderr, "%d > %d = %d\n",
                                               v, l, matched);
                }
                break;
@@ -478,13 +478,13 @@ struct magic *m;
                if (m->flag & UNSIGNED) {
                        matched = v < l;
                        if (debug)
-                               (void) fprintf(stderr, "%lu < %lu = %d\n",
+                               (void) fprintf(stderr, "%u < %u = %d\n",
                                               v, l, matched);
                }
                else {
                        matched = (int32) v < (int32) l;
                        if (debug)
-                               (void) fprintf(stderr, "%ld < %ld = %d\n",
+                               (void) fprintf(stderr, "%d < %d = %d\n",
                                               v, l, matched);
                }
                break;
@@ -492,14 +492,14 @@ struct magic *m;
        case '&':
                matched = (v & l) == l;
                if (debug)
-                       (void) fprintf(stderr, "((%lx & %lx) == %lx) = %d\n",
+                       (void) fprintf(stderr, "((%x & %x) == %x) = %d\n",
                                       v, l, l, matched);
                break;
 
        case '^':
                matched = (v & l) != l;
                if (debug)
-                       (void) fprintf(stderr, "((%lx & %lx) != %lx) = %d\n",
+                       (void) fprintf(stderr, "((%x & %x) != %x) = %d\n",
                                       v, l, l, matched);
                break;