fix off-by-one error (bug 1682)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9216 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2004-11-09 16:49:38 +00:00
parent 7f4c86a075
commit a899dc13c9
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2004-11-09 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* lengthcommon.C (unitFromString): fix off-by-one error (bug 1682)
2004-11-05 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* lyxfunc.C (dispatch): remove the verbose argument

View File

@ -61,7 +61,7 @@ char const * const unit_name_gui[] = {
LyXLength::UNIT unitFromString(string const & data)
{
int i = 0;
while (i < num_units && data != unit_name[i])
while (i < num_units - 1 && data != unit_name[i])
++i;
return static_cast<LyXLength::UNIT>(i);
}