8 Nov
2006
8 Nov
'06
17:15
On Tuesday 07 November 2006 16:10, Oliver Block wrote:
Hello everybody,
yesterday I was facing a problem. A system function gethostbyname() that expects one argument, a const char* causes a segmentation fault.
The function call code is - probably not saying much - the following:
char *http_send_recv(char *hostname, char *request) { struct hostent *hptr; ... if( hptr = gethostbyname( hostname )) memcpy(&sin.sin_addr, hptr->h_addr, hptr->h_length);
What does the code look like that calls http_send_recv? I'll bet good money the hostname pointer isn't properly allocated