Fix off-by-one error making it impossible to edit the first element of an array using array slicing. Thanks to useer for reporting this bug.

darcs-hash:20061208133136-ac50b-3c8085ec61fcc3987356ee412133dba6c7f32d1f.gz
This commit is contained in:
axel 2006-12-08 23:31:36 +10:00
parent f83b754cd4
commit b156f083be

View file

@ -274,11 +274,11 @@ static int update_values( array_list_t *list,
{
/*
The '- 1' below is because the indices in fish are
one-based, but the array_lsit_t uses zero-based indices
one-based, but the array_list_t uses zero-based indices
*/
long ind = al_get_long(indexes, i) - 1;
void *new = (void *) al_get(values, i);
if( ind <= 0 )
if( ind < 0 )
{
return 1;
}