projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
safe_fgets() - even more anal fgets()
[git.git]
/
pack-objects.c
diff --git
a/pack-objects.c
b/pack-objects.c
index
084c200
..
7d62477
100644
(file)
--- a/
pack-objects.c
+++ b/
pack-objects.c
@@
-915,9
+915,10
@@
int main(int argc, char **argv)
break;
if (!ferror(stdin))
die("fgets returned NULL, not EOF, not error!");
break;
if (!ferror(stdin))
die("fgets returned NULL, not EOF, not error!");
- if (errno == EINTR)
- continue;
- die("fgets: %s", strerror(errno));
+ if (errno != EINTR)
+ die("fgets: %s", strerror(errno));
+ clearerr(stdin);
+ continue;
}
if (progress_update) {
}
if (progress_update) {