Interesting little bug here:
if (host != NULL) { printf("hi"); } else { printf("FAIL"); } return 0;
doesn\'t prin
try using fflush(stdout) before your if condition.
fflush(stdout)
if