Anders
No one knows I'm schepe

Posts: 427
Registered: 03-02 |
Hi Quasar, i didn't know where to post this, since you left the channel about 3 minutes before i found it.
code:
for (; len > 0; len--)
{
char n = POP();
if (n <= 9)
{
**pinsertion = n + '0';
*pinsertion += 1;
}
else
{
**pinsertion = n - 10 + char10;
*pinsertion += 1;
}
}
*nmax -= len;
the author seems to have forgotten that len will be 0 after the for loop is done, so *nmax (which contains the number of characters left in the buffer) is never decreased. the easy fix is to use a temp variable for the for loop.
__________________
++++++++++[>++++++++++>++++++++++++>+++++++++++>++
+>+<<<<<-]>.>-.>>++.<<<++.>>+.+++.<--.>-----.+++++
+.>.<<<-----.>>-.<<++++.>>>.<<<++.------.>++++.>>>.
|