summaryrefslogtreecommitdiff
path: root/sftp-common.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-common.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 'sftp-common.c')
-rw-r--r--sftp-common.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sftp-common.c b/sftp-common.c
index 9dc1f9831..3a70c52dd 100644
--- a/sftp-common.c
+++ b/sftp-common.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sftp-common.c,v 1.28 2015/01/20 23:14:00 deraadt Exp $ */ 1/* $OpenBSD: sftp-common.c,v 1.29 2016/09/12 01:22:38 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2001 Markus Friedl. All rights reserved. 3 * Copyright (c) 2001 Markus Friedl. All rights reserved.
4 * Copyright (c) 2001 Damien Miller. All rights reserved. 4 * Copyright (c) 2001 Damien Miller. All rights reserved.
@@ -26,7 +26,6 @@
26 26
27#include "includes.h" 27#include "includes.h"
28 28
29#include <sys/param.h> /* MAX */
30#include <sys/types.h> 29#include <sys/types.h>
31#include <sys/stat.h> 30#include <sys/stat.h>
32 31
@@ -45,6 +44,7 @@
45#include "ssherr.h" 44#include "ssherr.h"
46#include "sshbuf.h" 45#include "sshbuf.h"
47#include "log.h" 46#include "log.h"
47#include "misc.h"
48 48
49#include "sftp.h" 49#include "sftp.h"
50#include "sftp-common.h" 50#include "sftp-common.h"
@@ -243,8 +243,8 @@ ls_file(const char *name, const struct stat *st, int remote, int si_units)
243 } 243 }
244 if (sz == 0) 244 if (sz == 0)
245 tbuf[0] = '\0'; 245 tbuf[0] = '\0';
246 ulen = MAX(strlen(user), 8); 246 ulen = MAXIMUM(strlen(user), 8);
247 glen = MAX(strlen(group), 8); 247 glen = MAXIMUM(strlen(group), 8);
248 if (si_units) { 248 if (si_units) {
249 fmt_scaled((long long)st->st_size, sbuf); 249 fmt_scaled((long long)st->st_size, sbuf);
250 snprintf(buf, sizeof buf, "%s %3u %-*s %-*s %8s %s %s", mode, 250 snprintf(buf, sizeof buf, "%s %3u %-*s %-*s %8s %s %s", mode,