![]() |
| | #1 |
| Tha 1 Sick RAT Join Date: Dec 2003
Posts: 267
| My broken inet_aton() Code: // inet_aton for windows
int inet_aton(const char *address, struct in_addr *sock){
int s;
s = inet_addr(address);
if ( s == 1 && strcmp (address, "255.255.255.225") )
return 0;
sock->s_addr = s;
return 1;
}
Code: inet_aton(s_address.c_str(), &cSock.sin_addr); Thanks
__________________ A hundred Elephants can knock down the walls of a fortress... One diseased rat can kill everyone inside |
| WDT is offline | |
| | #2 |
| Kernel hacker Join Date: Jul 2007 Location: Farncombe, Surrey, England
Posts: 15,686
| It's not clear which is "line 41" in the code you posted. According to what I can see, all the functions involved take a const char *, so we need to understand which line it is that is causing the problem. -- Mats
__________________ Compilers can produce warnings - make the compiler programmers happy: Use them! Please don't PM me for help - and no, I don't do help over instant messengers. |
| matsp is offline | |
| | #3 |
| Tha 1 Sick RAT Join Date: Dec 2003
Posts: 267
| Code: inet_aton(s_address.c_str(), &cSock.sin_addr);
__________________ A hundred Elephants can knock down the walls of a fortress... One diseased rat can kill everyone inside |
| WDT is offline | |
| | #4 |
| CSharpener Join Date: Oct 2006
Posts: 5,336
| are you sure your inet_aton function declared in every place the same way accepting const char* as a first parameter. Seems like it is declared somewhere in the header in another way
__________________ If I have eight hours for cutting wood, I spend six sharpening my axe. |
| vart is offline | |
| | #5 | |
| int x = *((int *) NULL); Join Date: Jul 2003 Location: Banks of the River Styx
Posts: 902
| Quote:
1 is a valid return value from inet_addr - the only special case you should be checking for is if inet_addr returns INADDR_NONE.
__________________ long time; /* know C? */ Unprecedented performance: Nothing ever ran this slow before. Any sufficiently advanced bug is indistinguishable from a feature. Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31. The best way to accelerate an IBM is at 9.8 m/s/s. recursion (re - cur' - zhun) n. 1. (see recursion) | |
| Cactus_Hugger is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| This CD Drive is broken? | alphaoide | Tech Board | 3 | 06-04-2005 02:59 PM |
| Is this a valid use of C++, or have I completely broken some major rules? | Lithorien | A Brief History of Cprogramming.com | 15 | 12-14-2004 05:43 PM |
| undeclared identifier problem | jjj93421 | C++ Programming | 13 | 04-24-2004 09:22 AM |
| broken pipe | samps005 | Linux Programming | 1 | 05-07-2003 09:04 PM |
| Resume a broken download | Echidna | Windows Programming | 2 | 01-06-2003 09:44 AM |