From: Morris Keesan Date: 2009-01-01T14:27:35+09:00 Subject: Re: Ruby arguments into C function are warped 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.