Anders Posted July 19, 2003 Hi Quasar, i didn't know where to post this, since you left the channel about 3 minutes before i found it. 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. 0 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.