From: Christos Zoulas Date: Wed, 15 Jan 1997 19:28:35 +0000 (+0000) Subject: \fix typos X-Git-Tag: FILE3_27~53 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=351cd434a332f66c408469bd509adda20fdf2926;p=file \fix typos --- diff --git a/src/file.c b/src/file.c index 22a3c442..aa8e663f 100644 --- a/src/file.c +++ b/src/file.c @@ -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 @@ -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 diff --git a/src/file.h b/src/file.h index 513ffd66..c2b96547 100644 --- a/src/file.h +++ b/src/file.h @@ -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.. */ diff --git a/src/fsmagic.c b/src/fsmagic.c index b34a89a2..dab854e7 100644 --- a/src/fsmagic.c +++ b/src/fsmagic.c @@ -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 diff --git a/src/print.c b/src/print.c index 17e1136a..15042ff3 100644 --- a/src/print.c +++ b/src/print.c @@ -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); diff --git a/src/readelf.c b/src/readelf.c index 6f6f3b40..a007cca3 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -1,6 +1,7 @@ #ifdef BUILTIN_ELF #include +#include #include #include #include @@ -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; diff --git a/src/softmagic.c b/src/softmagic.c index e79a1730..ab621d2a 100644 --- a/src/softmagic.c +++ b/src/softmagic.c @@ -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;