summaryrefslogtreecommitdiff
path: root/file/src/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file/src/file.c')
-rw-r--r--file/src/file.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/file/src/file.c b/file/src/file.c
index b23729007..425b82bea 100644
--- a/file/src/file.c
+++ b/file/src/file.c
@@ -12,11 +12,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Ian F. Darwin and others.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -77,7 +72,7 @@
#include "patchlevel.h"
#ifndef lint
-FILE_RCSID("@(#)$Id: file.c,v 1.93 2004/04/07 14:23:55 christos Exp $")
+FILE_RCSID("@(#)$Id: file.c,v 1.95 2004/09/27 15:28:37 christos Exp $")
#endif /* lint */
@@ -109,7 +104,7 @@ private char *separator = ":"; /* Default field separator */
/*@unchecked@*/ /*@null@*/
private char *progname; /* used throughout */
-/*@unchecked@*/ /*@observer@*/ /*@null@*/
+/*@unchecked@*/ /*@only@*/ /*@null@*/
private struct magic_set *magic;
private void unwrap(char *fn)
@@ -124,9 +119,9 @@ private void help(void)
/*@modifies fileSystem @*/;
#endif
#if 0
-private int byteconv4(int from, int same, int big_endian)
+private int byteconv4(int, int, int)
/*@*/;
-private short byteconv2(int from, int same, int big_endian)
+private short byteconv2(int, int, int)
/*@*/;
#endif
@@ -343,6 +338,8 @@ main(int argc, char *argv[])
process(argv[optind], wid);
}
+ magic_close(magic);
+ magic = NULL;
return 0;
}
@@ -394,7 +391,8 @@ unwrap(char *fn)
}
while (fgets(buf, MAXPATHLEN, f) != NULL) {
- buf[file_mbswidth(buf)-1] = '\0';
+ // cut off CR, we _need_ bytes here, not characters
+ buf[strlen(buf)-1] = '\0';
process(buf, wid);
if(nobuffer)
(void) fflush(stdout);