X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/95b6d681b1121e1be8955aa3f79dd39098edf4cf..c530e1c2a3a036d71942c354ba11b30a06341fd7:/lib-src/hexl.c diff --git a/lib-src/hexl.c b/lib-src/hexl.c index b31ab81253..89ea7d9f60 100644 --- a/lib-src/hexl.c +++ b/lib-src/hexl.c @@ -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-2011 Free Software Foundation, Inc. Author: Keith Gabryelski (according to authors.el) @@ -179,7 +178,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 +208,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 +285,5 @@ usage (void) exit (EXIT_FAILURE); } -/* arch-tag: 20e04fb7-926e-4e48-be86-64fe869ecdaa - (do not change this comment) */ /* hexl.c ends here */