diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-01-22 23:30:19 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-01-22 23:30:19 -0800 |
commit | 9055082ef8a2f1b9033f77f0eb2b9c756a306c01 (patch) | |
tree | 041665ff66c2bdab89f2f59976fb9ce0e2003ab0 /lib-src/hexl.c | |
parent | f77fabaf6bc1296631b1a4bcdf363721e19a3ac4 (diff) | |
download | emacs-9055082ef8a2f1b9033f77f0eb2b9c756a306c01.tar.gz |
Check return values of some library calls.
Diffstat (limited to 'lib-src/hexl.c')
-rw-r--r-- | lib-src/hexl.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib-src/hexl.c b/lib-src/hexl.c index aa5b370aade..e0a5166760a 100644 --- a/lib-src/hexl.c +++ b/lib-src/hexl.c @@ -179,7 +179,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 +209,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; } } } |