> I guess we could argue backwards and forwards and produce numbers that
> support both positions, while compilers get smarter and smarter... but I
> don't think it's worth it. Let's just fix the signedness issue you
> found, and leave it at that.

New patch. With the changes you suggested.

Beware that your

while(i != 0)
{
if (str[i--] == ch)
return i;
...

will not return the char at position i, but the char at position i-1
due to the i--. The patch below for-loops it correctly (I, I love
regression checks).