From 548a3e15c8a9fd43e7bb955e31b141ef66abd51c Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Fri, 11 Aug 2000 00:48:51 +0000 Subject: [PATCH] Eliminate use of MIN(). --- sim/common/ChangeLog | 4 ++++ sim/common/dv-sockser.c | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 3f945b5eb4b..3266d3a46af 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,7 @@ +2000-08-09 Andrew Cagney + + * dv-sockser.c (dv_sockser_init): Eliminate MIN macro. + 2000-07-27 Frank Ch. Eigler From Maciej W. Rozycki diff --git a/sim/common/dv-sockser.c b/sim/common/dv-sockser.c index fb457d4f0b0..d5e657732dd 100644 --- a/sim/common/dv-sockser.c +++ b/sim/common/dv-sockser.c @@ -74,7 +74,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #endif /* ! defined (FNBLOCK) */ #endif /* ! defined (O_NONBLOCK) */ -#define MIN(a,b) ((a) < (b) ? (a) : (b)) /* Compromise between eating cpu and properly busy-waiting. One could have an option to set this but for now that seems @@ -148,7 +147,9 @@ dv_sockser_init (SIM_DESC sd) sockser_addr); return SIM_RC_FAIL; } - tmp = MIN (port_str - sockser_addr, (int) sizeof hostname - 1); + tmp = port_str - sockser_addr; + if (tmp >= sizeof hostname) + tmp = sizeof (hostname) - 1; strncpy (hostname, sockser_addr, tmp); hostname[tmp] = '\000'; port = atoi (port_str + 1); -- 2.30.2