Mercurial > hg > audiodb
changeset 564:048688d47697
Fix for startup segfault (shifted the param parsing to the start of processArgs)
author | mas01mj |
---|---|
date | Wed, 24 Jun 2009 11:15:15 +0000 |
parents | c6036e0a511a |
children | 4bd5533d4bf4 |
files | audioDB.cpp |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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);