From 60b3e0e8e731cf215b57cff5973a7a9a41ff3d96 Mon Sep 17 00:00:00 2001 From: Matej Sekoranja Date: Mon, 2 Jun 2014 09:24:53 +0200 Subject: [PATCH] eget: -a=value fix --- testApp/remote/eget.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/testApp/remote/eget.cpp b/testApp/remote/eget.cpp index c528f20..7afc8d6 100644 --- a/testApp/remote/eget.cpp +++ b/testApp/remote/eget.cpp @@ -1464,9 +1464,18 @@ int main (int argc, char *argv[]) { string param = optarg; size_t eqPos = param.find('='); + if (eqPos==0) + { + // no name + + fprintf(stderr, "Parameter not specified in '-a name=value' form. ('eget -h' for help.)\n"); + return 1; + } if (eqPos==string::npos) { - //fprintf(stderr, "Parameter not specified in name=value form. ('eget -h' for help.)\n"); + // no value + + //fprintf(stderr, "Parameter not specified in '-a name=value' form. ('eget -h' for help.)\n"); //return 1; parameters.push_back(pair(param, "")); }