diff --git a/src/ChangeLog b/src/ChangeLog index 0b60ab4ff0..69d2844669 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-11-09 Jean-Marc Lasgouttes + + * lengthcommon.C (unitFromString): fix off-by-one error (bug 1682) + 2004-11-05 Jean-Marc Lasgouttes * lyxfunc.C (dispatch): remove the verbose argument diff --git a/src/lengthcommon.C b/src/lengthcommon.C index 89ff7e1a55..ffb01bc566 100644 --- a/src/lengthcommon.C +++ b/src/lengthcommon.C @@ -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(i); }