aboutsummaryrefslogtreecommitdiff
path: root/gdb/ser-tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/ser-tcp.c')
-rw-r--r--gdb/ser-tcp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c
index df3af4c..e689bd7 100644
--- a/gdb/ser-tcp.c
+++ b/gdb/ser-tcp.c
@@ -54,6 +54,7 @@
#include <signal.h>
#include "gdb_select.h"
+#include <algorithm>
#ifndef HAVE_SOCKLEN_T
typedef int socklen_t;
@@ -183,7 +184,7 @@ net_open (struct serial *scb, const char *name)
error (_("net_open: No colon in host name!")); /* Shouldn't ever
happen. */
- tmp = min (port_str - name, (int) sizeof hostname - 1);
+ tmp = std::min (port_str - name, (ptrdiff_t) sizeof hostname - 1);
strncpy (hostname, name, tmp); /* Don't want colon. */
hostname[tmp] = '\000'; /* Tie off host name. */
port = atoi (port_str + 1);