From: Eduardo Ramos Testillano Date: Fri, 3 Apr 2015 12:03:10 +0000 (+0200) Subject: Optional parameter could be null X-Git-Tag: REFACTORING_TESTING_LIBRARY~199 X-Git-Url: https://git.teslayout.com/public/public/public/?a=commitdiff_plain;h=deae6754c23826dba6046e76ff37b43939bca3c1;p=anna.git Optional parameter could be null --- diff --git a/example/diameter/pcapDecoder/main.cpp b/example/diameter/pcapDecoder/main.cpp index f456dc9..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;