Merge from emacs-23; up to 2010-06-22T07:41:10Z!rgm@gnu.org
[bpt/emacs.git] / lib-src / hexl.c
index 1fae8aa..f03663e 100644 (file)
@@ -1,6 +1,8 @@
 /* Convert files for Emacs Hexl mode.
-   Copyright (C) 1989, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-                 2008  Free Software Foundation, Inc.
+   Copyright (C) 1989, 2001-2011  Free Software Foundation, Inc.
+
+Author: Keith Gabryelski
+(according to authors.el)
 
 This file is not considered part of GNU Emacs.
 
@@ -46,12 +48,10 @@ int base = DEFAULT_BASE, un_flag = FALSE, iso_flag = FALSE, endian = 1;
 int group_by = DEFAULT_GROUPING;
 char *progname;
 
-void usage();
+void usage (void) NO_RETURN;
 
 int
-main (argc, argv)
-     int argc;
-     char *argv[];
+main (int argc, char **argv)
 {
   register long address;
   char string[18];
@@ -178,7 +178,9 @@ main (argc, argv)
 
 #define hexchar(x) (isdigit (x) ? x - '0' : x - 'a' + 10)
 
-             fread (buf, 1, 10, fp); /* skip 10 bytes */
+             /* Skip 10 bytes.  */
+             if (fread (buf, 1, 10, fp) != 10)
+               break;
 
              for (i=0; i < 16; ++i)
                {
@@ -206,7 +208,9 @@ main (argc, argv)
                  if (i < 16)
                    break;
 
-                 fread (buf, 1, 18, fp); /* skip 18 bytes */
+                 /* Skip 18 bytes.  */
+                 if (fread (buf, 1, 18, fp) != 18)
+                   break;
                }
            }
        }
@@ -275,13 +279,11 @@ main (argc, argv)
 }
 
 void
-usage ()
+usage (void)
 {
   fprintf (stderr, "usage: %s [-de] [-iso]\n", progname);
   exit (EXIT_FAILURE);
 }
 
-/* arch-tag: 20e04fb7-926e-4e48-be86-64fe869ecdaa
-   (do not change this comment) */
 
 /* hexl.c ends here */