summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2020-04-07 10:35:00 +0200
committerMauro Sardara <msardara@cisco.com>2020-04-07 10:35:00 +0200
commit512aa3a8c6f6a370e1b3968af26077e0cd5210e9 (patch)
treef1e1299202acd2136f8a569425bbd2175ccb8b0e
parent0ea5735b98f38beacf92dfdca74b7a6d5b3f7182 (diff)
[HICN-593] Fix higet crash when no uri is specified in command line
Change-Id: Iccf6740deaf853eed766dfae92489d2b0f7acd58 Signed-off-by: Mauro Sardara <msardara@cisco.com>
-rw-r--r--apps/higet/higet.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/higet/higet.cc b/apps/higet/higet.cc
index 2aa42e460..5877c96b3 100644
--- a/apps/higet/higet.cc
+++ b/apps/higet/higet.cc
@@ -252,7 +252,7 @@ long checkFileStatus(std::string file_name) {
void usage(char *program_name) {
std::cerr << "usage:" << std::endl;
std::cerr << program_name << " [option]... [url]..." << std::endl;
- std::cerr << program_name << "options:" << std::endl;
+ std::cerr << program_name << " options:" << std::endl;
std::cerr
<< "-O <out_put_path> = write documents to <out_put_file>"
<< std::endl;
@@ -303,8 +303,11 @@ int main(int argc, char **argv) {
}
}
- name = argv[optind];
+ if (!argv[optind]) {
+ usage(argv[0]);
+ }
+ name = argv[optind];
std::cerr << "Using name " << name << " and name first word "
<< conf.ipv6_first_word << std::endl;