#18 Improved error handling in DCC

open
nobody
None
5
2003-02-13
2003-02-13
Peter Hosey
No

this suggestion applies mainly to DCCGetLineGet, but could apply to other functions as well.

currently, file write errors are handled in the following manner:

char b;
b=!FSWrite(...);
if(b) {
//do things
} else
//file write error

my suggestion is to change this by these substitutions:

s/char b/OSStatus err = noErr/
s/b=!/err = /
s/(b)/err == noErr/

with the result of:

OSStatus err = noErr;
err = FSWrite(...);
if(err == noErr) {
//do things
} else
//file write error

Discussion