summaryrefslogtreecommitdiff
path: root/sftp-client.c
diff options
context:
space:
mode:
authorderaadt@openbsd.org <deraadt@openbsd.org>2016-09-12 01:22:38 +0000
committerDarren Tucker <dtucker@zip.com.au>2016-09-12 13:46:29 +1000
commit9136ec134c97a8aff2917760c03134f52945ff3c (patch)
treebfcab357e6e0f510d9b63bac43b18097e89fa58a /sftp-client.c
parentf219fc8f03caca7ac82a38ed74bbd6432a1195e7 (diff)
downloadopenssh-git-9136ec134c97a8aff2917760c03134f52945ff3c.tar.gz
upstream commit
Add MAXIMUM(), MINIMUM(), and ROUNDUP() to misc.h, then use those definitions rather than pulling <sys/param.h> and unknown namespace pollution. ok djm markus dtucker Upstream-ID: 712cafa816c9f012a61628b66b9fbd5687223fb8
Diffstat (limited to 'sftp-client.c')
-rw-r--r--sftp-client.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sftp-client.c b/sftp-client.c
index 0ca44a4d..e65c15c8 100644
--- a/sftp-client.c
+++ b/sftp-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-client.c,v 1.124 2016/05/25 23:48:45 schwarze Exp $ */
+/* $OpenBSD: sftp-client.c,v 1.125 2016/09/12 01:22:38 deraadt Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
@@ -22,7 +22,6 @@
#include "includes.h"
-#include <sys/param.h> /* MIN MAX */
#include <sys/types.h>
#ifdef HAVE_SYS_STATVFS_H
#include <sys/statvfs.h>
@@ -462,7 +461,7 @@ do_init(int fd_in, int fd_out, u_int transfer_buflen, u_int num_requests,
/* Some filexfer v.0 servers don't support large packets */
if (ret->version == 0)
- ret->transfer_buflen = MIN(ret->transfer_buflen, 20480);
+ ret->transfer_buflen = MINIMUM(ret->transfer_buflen, 20480);
ret->limit_kbps = limit_kbps;
if (ret->limit_kbps > 0) {
@@ -1351,7 +1350,7 @@ do_download(struct sftp_conn *conn, const char *remote_path,
req->offset, req->len, handle, handle_len);
/* Reduce the request size */
if (len < buflen)
- buflen = MAX(MIN_READ_SIZE, len);
+ buflen = MAXIMUM(MIN_READ_SIZE, len);
}
if (max_req > 0) { /* max_req = 0 iff EOF received */
if (size > 0 && offset > size) {