Morris Keesan
1/1/2009 5:28:00 AM
Also: not a Ruby issue, but a C issue: You've left yourself wide open
for a buffer overflow. Unless your Ruby code somehow guarantees that
the value of i will always be within the range 0..999999 (in which
case it really should be documented, and probably in a Ruby CONSTANT
and C #define), it's inevitable that some day some code will pass in a
negative value, or a value of 1000000 or greater, and your code will
mysteriously stop working correctly. Make sure, every time you access
your array, but especially when assigning to it, that you check that
the index is valid.