And to think that SC's engineering is praised among college kids is laughable.
1,044 karma · joined September 12, 2012
Edit: because at the end of the day, Facebook doesn't make the world a better place.
buf = calloc(huge, huge);
if (errno) perror("calloc failed");
printf("calloc(huge, huge) returned: %p\n", buf);
free(buf);
This has a flaw. errno doesn't magically get reset to zero. You should check the return value of calloc, then use errno. Checking if(errno) is not the right way to determine if there was an error.