* syscall.c (cb_syscall) <case CB_SYS_truncate>
[binutils-gdb.git] / sim / common / dv-sockser.c
index fb457d4f0b0dcd3286159c0ed4960c9101227b82..d5e657732dd863b73058eeaa84bb634fcf4052b6 100644 (file)
@@ -74,7 +74,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #endif /* ! defined (FNBLOCK) */
 #endif /* ! defined (O_NONBLOCK) */
 \f
-#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);