fixed two buffer overrun problems in addchar() for right to left mode