Skip to content
Snippets Groups Projects
Commit 04866a79 authored by Marcus Comstedt's avatar Marcus Comstedt
Browse files

Old test for invalid inet_addr didn't work when sizeof(long)>sizeof(int)...

Rev: src/modules/system/system.c:1.53
parent 02f92947
No related merge requests found
/* /*
* $Id: system.c,v 1.52 1998/05/17 19:28:09 grubba Exp $ * $Id: system.c,v 1.53 1998/05/29 19:24:20 marcus Exp $
* *
* System-call module for Pike * System-call module for Pike
* *
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "system.h" #include "system.h"
#include "global.h" #include "global.h"
RCSID("$Id: system.c,v 1.52 1998/05/17 19:28:09 grubba Exp $"); RCSID("$Id: system.c,v 1.53 1998/05/29 19:24:20 marcus Exp $");
#ifdef HAVE_WINSOCK_H #ifdef HAVE_WINSOCK_H
#include <winsock.h> #include <winsock.h>
#endif #endif
...@@ -750,7 +750,7 @@ void get_inet_addr(struct sockaddr_in *addr,char *name) ...@@ -750,7 +750,7 @@ void get_inet_addr(struct sockaddr_in *addr,char *name)
} }
else if(my_isipnr(name)) /* I do not entirely trust inet_addr */ else if(my_isipnr(name)) /* I do not entirely trust inet_addr */
{ {
if ((long)inet_addr(name) == (long)-1) if (inet_addr(name) == (in_addr_t)-1)
error("Malformed ip number.\n"); error("Malformed ip number.\n");
addr->sin_addr.s_addr = inet_addr(name); addr->sin_addr.s_addr = inet_addr(name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment