aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/fetch/fetch.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/fetch/fetch.c')
-rw-r--r--usr.bin/fetch/fetch.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c
index 34ee02e68f3a..7dfdbaf26e8c 100644
--- a/usr.bin/fetch/fetch.c
+++ b/usr.bin/fetch/fetch.c
@@ -503,7 +503,8 @@ fetch(char *URL, const char *path)
/* suck in the data */
signal(SIGINFO, sig_handler);
while (!sigint && !sigalrm) {
- if (us.size != -1 && us.size - count < B_size)
+ if (us.size != -1 && us.size - count < B_size &&
+ us.size - count >= 0)
size = us.size - count;
else
size = B_size;