summaryrefslogtreecommitdiff
path: root/sshkey.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 /sshkey.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 'sshkey.c')
-rw-r--r--sshkey.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sshkey.c b/sshkey.c
index 166ac714d..8f6173e27 100644
--- a/sshkey.c
+++ b/sshkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshkey.c,v 1.36 2016/08/03 05:41:57 djm Exp $ */
+/* $OpenBSD: sshkey.c,v 1.37 2016/09/12 01:22:38 deraadt Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
* Copyright (c) 2008 Alexander von Gernler. All rights reserved.
@@ -27,7 +27,6 @@
#include "includes.h"
-#include <sys/param.h> /* MIN MAX */
#include <sys/types.h>
#include <netinet/in.h>
@@ -1082,10 +1081,10 @@ fingerprint_randomart(const char *alg, u_char *dgst_raw, size_t dgst_raw_len,
y += (input & 0x2) ? 1 : -1;
/* assure we are still in bounds */
- x = MAX(x, 0);
- y = MAX(y, 0);
- x = MIN(x, FLDSIZE_X - 1);
- y = MIN(y, FLDSIZE_Y - 1);
+ x = MAXIMUM(x, 0);
+ y = MAXIMUM(y, 0);
+ x = MINIMUM(x, FLDSIZE_X - 1);
+ y = MINIMUM(y, FLDSIZE_Y - 1);
/* augment the field */
if (field[x][y] < len - 2)
@@ -1126,7 +1125,7 @@ fingerprint_randomart(const char *alg, u_char *dgst_raw, size_t dgst_raw_len,
for (y = 0; y < FLDSIZE_Y; y++) {
*p++ = '|';
for (x = 0; x < FLDSIZE_X; x++)
- *p++ = augmentation_string[MIN(field[x][y], len)];
+ *p++ = augmentation_string[MINIMUM(field[x][y], len)];
*p++ = '|';
*p++ = '\n';
}