Updated copyright notices for most files.
[deliverable/binutils-gdb.git] / sim / common / dv-sockser.c
index fb457d4f0b0dcd3286159c0ed4960c9101227b82..34d17fd2b41bfb9c23fc4bc100a5cd676512ec87 100644 (file)
@@ -1,20 +1,19 @@
 /* Serial port emulation using sockets.
-   Copyright (C) 1998 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2007, 2008 Free Software Foundation, Inc.
    Contributed by Cygnus Solutions.
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+the Free Software Foundation; either version 3 of the License, or
+(at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* FIXME: will obviously need to evolve.
    - connectionless sockets might be more appropriate.  */
@@ -74,7 +73,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 +146,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);
This page took 0.024339 seconds and 4 git commands to generate.