diff options
author | Andrew Cagney <cagney@redhat.com> | 2000-08-11 00:48:51 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2000-08-11 00:48:51 +0000 |
commit | 548a3e15c8a9fd43e7bb955e31b141ef66abd51c (patch) | |
tree | 693fb21cc82b6af762b0dafb006f26cdfa920d9a /sim/common/dv-sockser.c | |
parent | 0e43f15b0ce7942c03bd0abcc499c87d553b4dc1 (diff) | |
download | gdb-548a3e15c8a9fd43e7bb955e31b141ef66abd51c.zip gdb-548a3e15c8a9fd43e7bb955e31b141ef66abd51c.tar.gz gdb-548a3e15c8a9fd43e7bb955e31b141ef66abd51c.tar.bz2 |
Eliminate use of MIN().
Diffstat (limited to 'sim/common/dv-sockser.c')
-rw-r--r-- | sim/common/dv-sockser.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sim/common/dv-sockser.c b/sim/common/dv-sockser.c index fb457d4..d5e6577 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); |