Interesting little bug here:
if (host != NULL) {
printf("hi");
} else {
printf("FAIL");
}
return 0;
doesn’t print anything at all, but:
if (host != NULL) {
printf("hi");
} else {
printf("FAIL");
}
fprintf(stdout, "\n%s\n", (char *)&additionalargs);
return 0;
prints
hi
abc
Does anyone know why this is?
The difference is the \n characters.
As you printf characters, they are accumulated in a buffer which isn’t sent to the output device until an ‘end of line’ character is sent.