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
diff --git a/sftp-client.c b/sftp-client.c
index 0ca44a4..e65c15c 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 @@
/* 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 @@
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) {