No, you're still modifying host->h_name. You need to make a copy of h_name first, then do the manipulation, like this:
-Greg DolleyCode:char *host_name = NULL; host_name = (char *)malloc(sizeof(char)*(strlen(host->h_name)+1)); strcpy(host_name, host->h_name);




Reply With Quote