From 1dd0eb26bbb9db39bcc34d87a758caf36987cd05 Mon Sep 17 00:00:00 2001 From: "Matthias Huetsch [mhu]" Date: Thu, 3 Feb 2011 18:44:31 +0100 Subject: #i115784# registry/tools: fix initOptions_Impl() commandline argument processing. --- registry/tools/checksingleton.cxx | 4 ++-- registry/tools/regcompare.cxx | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'registry/tools') diff --git a/registry/tools/checksingleton.cxx b/registry/tools/checksingleton.cxx index 680201c590d5..e4fc39449e37 100644 --- a/registry/tools/checksingleton.cxx +++ b/registry/tools/checksingleton.cxx @@ -146,7 +146,7 @@ bool Options_Impl::initOptions_Impl(std::vector< std::string > & rArgs) case 'f': case 'F': { - if ((*first)[2] != 0) + if ((*first).size() > 2) { return badOption("invalid", option.c_str()); } @@ -156,7 +156,7 @@ bool Options_Impl::initOptions_Impl(std::vector< std::string > & rArgs) case 'h': case '?': { - if ((*first)[2] != 0) + if ((*first).size() > 2) { return badOption("invalid", option.c_str()); } diff --git a/registry/tools/regcompare.cxx b/registry/tools/regcompare.cxx index 86c06c272163..3e415cec43fc 100644 --- a/registry/tools/regcompare.cxx +++ b/registry/tools/regcompare.cxx @@ -208,7 +208,7 @@ bool Options_Impl::initOptions_Impl (std::vector< std::string > & rArgs) case 'f': case 'F': { - if ((*first)[2] != 0) + if ((*first).size() > 2) { return badOption("invalid", (*first).c_str()); } @@ -218,7 +218,7 @@ bool Options_Impl::initOptions_Impl (std::vector< std::string > & rArgs) case 'c': case 'C': { - if ((*first)[2] != 0) + if ((*first).size() > 2) { return badOption("invalid", (*first).c_str()); } @@ -228,7 +228,7 @@ bool Options_Impl::initOptions_Impl (std::vector< std::string > & rArgs) case 't': case 'T': { - if ((*first)[2] != 0) + if ((*first).size() > 2) { return badOption("invalid", (*first).c_str()); } @@ -238,7 +238,7 @@ bool Options_Impl::initOptions_Impl (std::vector< std::string > & rArgs) case 'u': case 'U': { - if ((*first)[2] != 0) + if ((*first).size() > 2) { return badOption("invalid", (*first).c_str()); } @@ -248,7 +248,7 @@ bool Options_Impl::initOptions_Impl (std::vector< std::string > & rArgs) case 'h': case '?': { - if ((*first)[2] != 0) + if ((*first).size() > 2) { return badOption("invalid", (*first).c_str()); } -- cgit