summaryrefslogtreecommitdiff
path: root/scp.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 /scp.c
parentf219fc8f03caca7ac82a38ed74bbd6432a1195e7 (diff)
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 'scp.c')
-rw-r--r--scp.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/scp.c b/scp.c
index 43ca3fa09..c67cd71df 100644
--- a/scp.c
+++ b/scp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: scp.c,v 1.186 2016/05/25 23:48:45 schwarze Exp $ */ 1/* $OpenBSD: scp.c,v 1.187 2016/09/12 01:22:38 deraadt Exp $ */
2/* 2/*
3 * scp - secure remote copy. This is basically patched BSD rcp which 3 * scp - secure remote copy. This is basically patched BSD rcp which
4 * uses ssh to do the data transfer (instead of using rcmd). 4 * uses ssh to do the data transfer (instead of using rcmd).
@@ -74,7 +74,6 @@
74#include "includes.h" 74#include "includes.h"
75 75
76#include <sys/types.h> 76#include <sys/types.h>
77#include <sys/param.h>
78#ifdef HAVE_SYS_STAT_H 77#ifdef HAVE_SYS_STAT_H
79# include <sys/stat.h> 78# include <sys/stat.h>
80#endif 79#endif
@@ -383,7 +382,7 @@ main(int argc, char **argv)
383 setlocale(LC_CTYPE, ""); 382 setlocale(LC_CTYPE, "");
384 383
385 /* Copy argv, because we modify it */ 384 /* Copy argv, because we modify it */
386 newargv = xcalloc(MAX(argc + 1, 1), sizeof(*newargv)); 385 newargv = xcalloc(MAXIMUM(argc + 1, 1), sizeof(*newargv));
387 for (n = 0; n < argc; n++) 386 for (n = 0; n < argc; n++)
388 newargv[n] = xstrdup(argv[n]); 387 newargv[n] = xstrdup(argv[n]);
389 argv = newargv; 388 argv = newargv;
@@ -1343,7 +1342,7 @@ allocbuf(BUF *bp, int fd, int blksize)
1343 run_err("fstat: %s", strerror(errno)); 1342 run_err("fstat: %s", strerror(errno));
1344 return (0); 1343 return (0);
1345 } 1344 }
1346 size = roundup(stb.st_blksize, blksize); 1345 size = ROUNDUP(stb.st_blksize, blksize);
1347 if (size == 0) 1346 if (size == 0)
1348 size = blksize; 1347 size = blksize;
1349#else /* HAVE_STRUCT_STAT_ST_BLKSIZE */ 1348#else /* HAVE_STRUCT_STAT_ST_BLKSIZE */