Again, I'm really new at this. I've tried searching on strings, strstr, etc. Stuff I found didn't seem to apply.
Code:
char *domainResponse=malloc(1000);
while(fgets(domainResponse, 1000, fp) != NULL)
{
/* String function here to search for 'no match for domain' */
/*fputs(domainResponse, stdout);*/
}
printf("%s\n", domainResponse);
I get nothing printed out.
Now, if I remove the comments from line 3 like this:
Code:
char *domainResponse=malloc(1000);
while(fgets(domainResponse, 1000, fp) != NULL)
{
/* String function here to search for 'no match for domain' */
fputs(domainResponse, stdout);
}
/*printf("%s\n", domainResponse);*/
I get the results of the bw-whois lookup printed to the screen (actually, a html page)
I tried a strstr(domainResponse, "No match for domain") - but it always returned NULL, which led me to check what was in domainResponse. Seems if I do the fputs, domainResponse contains text; but if I just try to printf it, domainResponse seems empty. With the fputs operation, domainResponse has a long text paragraph.
Please help.
Thanks,
Tim