Skip to content

Commit b83a55b

Browse files
natoscottclaude
andcommitted
Use Char_isControl() in non-wide RichString rendering
Replace the >= 32 byte check with Char_isControl() which also filters DEL (0x7F), consistent with the wide-char path that uses iswprint(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 001eb63 commit b83a55b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

RichString.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static inline int RichString_writeFromWide(RichString* this, int attrs, const ch
197197
size_t newLen = from + len;
198198
RichString_setLen(this, newLen);
199199
for (size_t i = from, j = 0; i < newLen; i++, j++) {
200-
this->chptr[i] = (((unsigned char)data_c[j]) >= 32 ? ((unsigned char)data_c[j]) : '?') | attrs;
200+
this->chptr[i] = (Char_isControl(data_c[j]) ? '?' : (unsigned char)data_c[j]) | attrs;
201201
}
202202
this->chptr[newLen] = 0;
203203

0 commit comments

Comments
 (0)