Good catch, thanks. It's a long shot, since strlen(cPtr) has to be > 8192 chars to start with, and then the buffer gets doubled each time, but it's good to avoid buffer overflows. I changed the algorithm to adjust for this.