Menu

#4 compile error

open
nobody
None
5
2010-03-07
2010-03-07
tener hades
No

i've verified the error that others are getting at line 203/204 in init.c in the current release.

intead of setting

no_file:

to

no_file:;

i like my command prompts to be a little more verbose than that. if you have a debugging option set, then you could something like:

no_file:
#ifdef DEBUG // or if(debug_option) depeding on whether this needs to be compile time or not
fprintf(stderr,"No config file found.\n");
#endif
return;

i believe goto's and labels are a bit deprecated though. unless you have other curious code in there, it's probably better to check for the existance of the file at the beginning of the function, or in the calling function and not even call that part of that function if you don't have to... (of course you'd have to make that particular subroutine it's own function which involves passing all kinds of stuff... oh well);

also, it seems like a user might be able modify the config file to include other, arbitrary commands and when you're code is run - and run as root especially - these other arbitrary commands will be run. maybe even totally replacing the ones you've intended. maybe there should be an integrity check on the config file or instead of strcpy, maybe strncpy or other limiting method.

idk... thanks for the program anways.

Discussion


Log in to post a comment.