I'm going to apply it, but with this small change: - csiescseq.mode[1] = *p; + csiescseq.mode[1] = (p < csiescseq.buf+csiescseq.len) ? *p : '\0';
because my suggestion was not totally true, and it was possible go further of the end of the string. Regards,