]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/l_net/l_net_wins.c
[quake3/q3map2/brush.c] Fix arithmetic bug
[xonotic/netradiant.git] / libs / l_net / l_net_wins.c
index 36f31a8ce7c34e9d227097454161d10fa75749ac..30ef9ac035d23cc39deb7cd5b8a547a8feafe3a0 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 1999-2007 id Software, Inc. and contributors.
+   Copyright (C) 1999-2006 Id Software, Inc. and contributors.
    For a list of contributors, see the accompanying CONTRIBUTORS file.
 
    This file is part of GtkRadiant.
@@ -136,19 +136,13 @@ ERROR_STRUCT errlist[] = {
        {-1,                 NULL}
 };
 
-#ifdef _DEBUG
-void WinPrint( char *str, ... );
-#else
-void WinPrint( char *str, ... );
-#endif
-
 //===========================================================================
 //
 // Parameter:                          -
 // Returns:                                    -
 // Changes Globals:            -
 //===========================================================================
-char *WINS_ErrorMessage( int error ){
+const char *WINS_ErrorMessage( int error ){
        int search = 0;
 
        if ( !error ) {
@@ -202,7 +196,10 @@ int WINS_Init( void ){
        // determine my name & address
        gethostname( buff, MAXHOSTNAMELEN );
        local = gethostbyname( buff );
-       myAddr = *(int *)local->h_addr_list[0];
+       if(local && local->h_addr_list && local->h_addr_list[0])
+               myAddr = *(int *)local->h_addr_list[0];
+       else
+               myAddr = inet_addr("127.0.0.1");
 
        // if the quake hostname isn't set, set it to the machine name
 //     if (Q_strcmp(hostname.string, "UNNAMED") == 0)
@@ -262,7 +259,7 @@ void WINS_Shutdown( void ){
        WINS_CloseSocket( net_controlsocket );
        WSACleanup();
        //
-       WinPrint( "Winsock Shutdown\n" );
+       //WinPrint("Winsock Shutdown\n");
 } //end of the function WINS_Shutdown
 //===========================================================================
 //