3 ms·
Be sure that your error-handling code checks for errors. while(printf("Error!\n")+1 != sizeof "Error!\n") ; Also, it should be bug-free.
by burfog 6y ago
Be sure that your error-handling code checks for errors.
while(printf("Error!\n")+1 != sizeof "Error!\n")
;
Also, it should be bug-free.
- burfog 6y agoNo, wait, like this: void got_error(void){ char err[] = "Error!\n"; int len = strlen(err); int ret = printf(err); if(len != ret) got_error(); } Obviously, if the error routine faces an error, it should call the error routine. That is how you handle errors. Er, but maybe the error routine should also return an error flag in that case? The caller could then check it and call the error routine if needed.