> That code is really difficult to read, and hence difficult to get
> correct. Since we've already been burned twice by it, let's make it less
> error-prone. How about the attached? Does that look correct to you?
Thanks for looking at this, I don't see a problem in your patch; the code
should not change behavior (except not touching outside array borders).