summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Osterried <thomas@osterried.de>2009-01-24 10:09:13 +0000
committerThomas Osterried <thomas@osterried.de>2009-01-24 10:09:13 +0000
commit4811124e8b043c61c8a9a4397ad9a8427b02d15a (patch)
tree1eef716a086b08ebf05270d80309a0420ff0d0eb
parent5e278be32663705b0441d462e8d8e8513b4eee19 (diff)
smaller fixes
-rw-r--r--call/call.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/call/call.c b/call/call.c
index 72ba9ff..5fad944 100644
--- a/call/call.c
+++ b/call/call.c
@@ -629,16 +629,16 @@ int start_ab_download(int mode, WINDOW ** swin, wint * wintab,
}
gp->calc_crc = 0;
} else {
- int offset = 0;
- while (bytes > 0) {
- int ret = write(gp->dwn_file, buf, bytes);
+ unsigned long int offset = 0L;
+ while (offset != bytes) {
+ int ret = write(gp->dwn_file, buf+offset, bytes-offset);
if (ret == -1)
continue;
if (ret == 0)
break;
gp->calc_crc = calc_crc(buf, ret, 0);
gp->dwn_cnt -= ret;
- bytes -= ret;
+ offset += ret;
}
}
@@ -2013,7 +2013,7 @@ out_fd:
break;
}
if (bytes > 0) {
- int offset = 0;
+ unsigned long offset = 0L;
sevenplus = FALSE;
if (uploadfile != -1) {
statline(mode,
@@ -2022,14 +2022,13 @@ out_fd:
}
convert_lf_cr(buf, bytes);
- while (bytes > 0) {
- int ret = write(fd, buf + offset, bytes);
+ while (offset != bytes) {
+ int ret = write(fd, buf+offset, bytes-offset);
if (ret == -1) {
perror("write");
break;
}
- offset += bytes;
- bytes -= ret;
+ offset += ret;
}
}
}