summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/sftp-client.c
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2007-09-16 00:55:53 +0000
committerDamien Miller <djm@cvs.openbsd.org>2007-09-16 00:55:53 +0000
commit9cc048eb49ae7f53cad96585ad66a60137b5738e (patch)
treed335413dc3db9a06ff27522d81bc341be563032d /usr.bin/ssh/sftp-client.c
parentb91eb8445b9ffe03143c4a5031d327b16b250b23 (diff)
use off_t instead of u_int64_t for file offsets, matching what the
progressmeter code expects; bz #842
Diffstat (limited to 'usr.bin/ssh/sftp-client.c')
-rw-r--r--usr.bin/ssh/sftp-client.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/ssh/sftp-client.c b/usr.bin/ssh/sftp-client.c
index 78f364d0ce6..42b2ea2b461 100644
--- a/usr.bin/ssh/sftp-client.c
+++ b/usr.bin/ssh/sftp-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-client.c,v 1.76 2007/01/22 11:32:50 djm Exp $ */
+/* $OpenBSD: sftp-client.c,v 1.77 2007/09/16 00:55:52 djm Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
@@ -984,7 +984,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
{
int local_fd, status;
u_int handle_len, id, type;
- u_int64_t offset;
+ off_t offset;
char *handle, *data;
Buffer msg;
struct stat sb;
@@ -994,7 +994,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
struct outstanding_ack {
u_int id;
u_int len;
- u_int64_t offset;
+ off_t offset;
TAILQ_ENTRY(outstanding_ack) tq;
};
TAILQ_HEAD(ackhead, outstanding_ack) acks;
@@ -1133,12 +1133,14 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
status = -1;
goto done;
}
- debug3("In write loop, ack for %u %u bytes at %llu",
- ack->id, ack->len, (unsigned long long)ack->offset);
+ debug3("In write loop, ack for %u %u bytes at %lld",
+ ack->id, ack->len, (long long)ack->offset);
++ackid;
xfree(ack);
}
offset += len;
+ if (offset < 0)
+ fatal("%s: offset < 0", __func__);
}
if (showprogress)
stop_progress_meter();