diff options
author | deraadt@openbsd.org <deraadt@openbsd.org> | 2016-09-12 03:22:38 +0200 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2016-09-12 05:46:29 +0200 |
commit | 9136ec134c97a8aff2917760c03134f52945ff3c (patch) | |
tree | bfcab357e6e0f510d9b63bac43b18097e89fa58a /sshkey.c | |
parent | upstream commit (diff) | |
download | openssh-9136ec134c97a8aff2917760c03134f52945ff3c.tar.xz openssh-9136ec134c97a8aff2917760c03134f52945ff3c.zip |
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.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -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'; } |