]> code.delx.au - gnu-emacs/blobdiff - lib-src/hexl.c
Merge latest Org fixes (commit 7524ef2).
[gnu-emacs] / lib-src / hexl.c
index b31ab812534c28ed83aa7b9ae05165509d2ed31d..3208a895aa25aae455d5b4fb4d4b97f5b31ac300 100644 (file)
@@ -1,6 +1,5 @@
 /* Convert files for Emacs Hexl mode.
-   Copyright (C) 1989, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-                 2009, 2010  Free Software Foundation, Inc.
+   Copyright (C) 1989, 2001-2013 Free Software Foundation, Inc.
 
 Author: Keith Gabryelski
 (according to authors.el)
@@ -21,9 +20,7 @@ You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
 
 #include <stdio.h>
 #include <ctype.h>
@@ -49,7 +46,7 @@ int base = DEFAULT_BASE, un_flag = FALSE, iso_flag = FALSE, endian = 1;
 int group_by = DEFAULT_GROUPING;
 char *progname;
 
-void usage(void) NO_RETURN;
+_Noreturn void usage (void);
 
 int
 main (int argc, char **argv)
@@ -179,7 +176,9 @@ main (int argc, char **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)
                {
@@ -207,7 +206,9 @@ main (int argc, char **argv)
                  if (i < 16)
                    break;
 
-                 fread (buf, 1, 18, fp); /* skip 18 bytes */
+                 /* Skip 18 bytes.  */
+                 if (fread (buf, 1, 18, fp) != 18)
+                   break;
                }
            }
        }
@@ -282,7 +283,5 @@ usage (void)
   exit (EXIT_FAILURE);
 }
 
-/* arch-tag: 20e04fb7-926e-4e48-be86-64fe869ecdaa
-   (do not change this comment) */
 
 /* hexl.c ends here */