Author: sh-sh-sh Date: Fri Apr 4 14:27:43 2008 New Revision: 46093 URL: http://svn.opensuse.org/viewcvs/yast?rev=46093&view=rev Log: off-by one error in args check Modified: trunk/libyui/src/YCommandLine.cc Modified: trunk/libyui/src/YCommandLine.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/src/YCommandLine.cc?rev=46... ============================================================================== --- trunk/libyui/src/YCommandLine.cc (original) +++ trunk/libyui/src/YCommandLine.cc Fri Apr 4 14:27:43 2008 @@ -105,7 +105,7 @@ string YCommandLine::arg( int index ) const { - YUI_CHECK_INDEX( index, 0, (int) priv->args.size() ); + YUI_CHECK_INDEX( index, 0, (int) priv->args.size()-1 ); return priv->args[ index ]; } @@ -114,15 +114,16 @@ void YCommandLine::remove( int index ) { - YUI_CHECK_INDEX( index, 0, (int) priv->args.size() ); + YUI_CHECK_INDEX( index, 0, (int) priv->args.size()-1 ); + priv->args.erase( priv->args.begin() + index ); } void YCommandLine::replace( int index, const string & newArg ) { - YUI_CHECK_INDEX( index, 0, (int) priv->args.size() ); + YUI_CHECK_INDEX( index, 0, (int) priv->args.size()-1 ); priv->args[ index ] = newArg; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org