If I'm understanding everything right, there is a problem with config parser callback in bogoutil.
bogoutil.c calls common config parser code - read_config_file() in configfile.c
read_config_file() calls process_config_option() -> process_config_option_as_arg() -> and finally calls process_arg()
But bogoutil.c does not provide own public process_arg() function with correct prototype. So linker will randomly pick one of existing versions in library - either from bogolexer.c, either from bogoconfig.c, with unpredictable side effects.
I think that address of process_arg() must be passed to read_config_file() and similar functions as parameter, like it's already done with longopts_xxx. Of course, all these callback functions much have same prototype (now process_arg() in bogoutil.c have different (simplified) prototype).
Also there are references to optarg in bogoutil's process_arg() which, I think, are incorrect for unified scheme.
Log in to post a comment.