From 6520b63cb25580420e477cba2c776b2639cbf21b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 21 Mar 2018 13:19:18 +0200 Subject: Guarantee validity of values returned by scanner for two arguments --- cli/options.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cli/options.cxx') diff --git a/cli/options.cxx b/cli/options.cxx index 43f271b..a59fb66 100644 --- a/cli/options.cxx +++ b/cli/options.cxx @@ -274,9 +274,9 @@ namespace cli return base::next (); else { - hold_.swap (args_.front ()); + hold_[i_ == 0 ? ++i_ : --i_].swap (args_.front ()); args_.pop_front (); - return hold_.c_str (); + return hold_[i_].c_str (); } } @@ -420,7 +420,7 @@ namespace cli { using namespace std; - string o (s.next ()); + const char* o (s.next ()); if (s.more ()) { -- cgit v1.1