X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2FpcapDecoder%2Fmain.cpp;h=7dd71c4216713c20a8877b2c8a1f5933644b591a;hb=deae6754c23826dba6046e76ff37b43939bca3c1;hp=f3330b7f9184e9fd0f3c8dd6fe930b92a9f4d3b5;hpb=6fd8a743ddef469fef5bbd6095398188fb6fc829;p=anna.git diff --git a/example/diameter/pcapDecoder/main.cpp b/example/diameter/pcapDecoder/main.cpp index f3330b7..7dd71c4 100644 --- a/example/diameter/pcapDecoder/main.cpp +++ b/example/diameter/pcapDecoder/main.cpp @@ -304,7 +304,7 @@ int main(int argc, char **argv) // Command-line parameters: std::string dictionaries = argv[1]; std::string pcapFile = argv[2]; - std::string optional = argv[3]; + std::string optional = argv[3] ? argv[3] : ""; bool ignoreFlags = ((argc == 4) && (optional == "--ignore-flags")); std::cout << "Dictionary(ies) provided: " << dictionaries << std::endl; std::cout << "Pcap file provided: " << pcapFile << std::endl; @@ -339,11 +339,12 @@ int main(int argc, char **argv) //LOGDEBUG(anna::Logger::debug(codecEngine->asString(), ANNA_FILE_LOCATION)); if (lst.size() > 1) { - std::ofstream out("./dictionary.xml", std::ifstream::out); + std::string all_in_one = "./dictionary-all-in-one.xml"; + std::ofstream out(all_in_one, std::ifstream::out); std::string buffer = d->asXMLString(); out.write(buffer.c_str(), buffer.size()); out.close(); - std::cout << "Written 'dictionary.xml' (provide it next time to be more comfortable)." << std::endl; + std::cout << "Written '" << all_in_one << "' (provide it next time to be more comfortable)." << std::endl; } } catch (anna::RuntimeException &ex) {