public
/
FUZIX.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
83ac9d7
)
tar: bugfix: check for error on read()
author
Brett Gordon
<beretta42@gmail.com>
Tue, 6 Jun 2017 22:42:09 +0000
(18:42 -0400)
committer
Brett Gordon
<beretta42@gmail.com>
Tue, 6 Jun 2017 22:42:09 +0000
(18:42 -0400)
Applications/util/tar.c
patch
|
blob
|
history
diff --git
a/Applications/util/tar.c
b/Applications/util/tar.c
index
5af8897
..
40a5fd6
100644
(file)
--- a/
Applications/util/tar.c
+++ b/
Applications/util/tar.c
@@
-454,8
+454,12
@@
static void extract(char *argv[])
while (1) {
x = read(infile, &h, 512);
+ if (x < 0 ){
+ perror(ofile);
+ exit(1);
+ }
if (x < 512) {
- fprintf(stderr, "bad
filesize\n"
);
+ fprintf(stderr, "bad
read size: %d\n", x
);
exit(1);
}