# HG changeset patch # User mas01mj # Date 1245842115 0 # Node ID 048688d476979dd1b1aa164a09f399b959669b6e # Parent c6036e0a511a9de6187dc1c2f6767ae577672136 Fix for startup segfault (shifted the param parsing to the start of processArgs) diff -r c6036e0a511a -r 048688d47697 audioDB.cpp --- a/audioDB.cpp Thu Jun 18 11:01:31 2009 +0000 +++ b/audioDB.cpp Wed Jun 24 11:15:15 2009 +0000 @@ -165,6 +165,12 @@ int audioDB::processArgs(const unsigned argc, const char *argv[]){ + /* KLUDGE: gengetopt generates a function which is not completely + const-clean in its declaration. We cast argv here to keep the + compiler happy. -- CSR, 2008-10-08 */ + if (cmdline_parser (argc, (char *const *) argv, &args_info) != 0) + error("Error parsing command line"); + if(argc<2){ cmdline_parser_print_version (); if (strlen(gengetopt_args_info_purpose) > 0) @@ -176,12 +182,6 @@ exit(0); } - /* KLUDGE: gengetopt generates a function which is not completely - const-clean in its declaration. We cast argv here to keep the - compiler happy. -- CSR, 2008-10-08 */ - if (cmdline_parser (argc, (char *const *) argv, &args_info) != 0) - error("Error parsing command line"); - if(args_info.help_given){ cmdline_parser_print_help(); exit(0);