MrGuest, that works, but it introduces conditions that will be checked for every loop. It's not much, but it's inefficient, and would be avoided if goto behaved a little more like C.
Uhrwerk, I don't want to introduce a function I'm only going to use once, but I agree it's the "cleanest" solution without goto.
I went with Superku's because it's a little more efficient, and I don't need to preserve i or j -- I do everything I need to with them within the loop.
I understand Lite-C isn't the same as C in every respect, but "goto" is really useless here.