I got nothing spectacular from that, but changing the \x00s to QRS gave me something interesting: without the loop, readrune gives me [?]S, but with it it, it gives me [?]QRS, like cat would've.

Would this be because fullrune doesn't check for validity, and if chartorune fails then the possibility of eating too much comes about?

On Jul 10, 2008, at 2:53 PM, Russ Cox wrote:

Hello. I was looking at the code for the Bgetrune function trying to
implement a readrune() around read(). It works, but without a
counterpart for this:

                while(i > bp->runesize) {
                        Bungetc(bp);
                        i--;
                }

What is the point of that loop? Thanks.

Use "\xE0\x00\x00" as your input and you will find out.

Russ




Reply via email to