busybox-1.32.0/libbb/lineedit.c
static void BB_PUTCHAR(wchar_t c)
{
	if (unicode_status == UNICODE_ON) {
		char buf[MB_CUR_MAX + 1];
		mbstate_t mbst = { 0 };
		ssize_t len = wcrtomb(buf, c, &mbst);
		if (len > 0) {
			buf[len] = '\0';
			fputs(buf, stdout);
		}
	} else {
		/* In this case, c is always one byte */
		putchar(c);
	}
}
/* I thought just fputwc(c, stdout) would work. But no... */
I thought just fputwc(c, stdout) would work. But no
I thought just fputwc ( c stdout ) would work . But no
static void BB_PUTCHAR(wchar_t c)
{
	if (unicode_status == UNICODE_ON) {
		char buf[MB_CUR_MAX + 1];
		mbstate_t mbst = { 0 };
		ssize_t len = wcrtomb(buf, c, &mbst);
		if (len > 0) {
			buf[len] = '\0';
			fputs(buf, stdout);
		}
	} else {
		putchar(c);
	}
}
static void BB_PUTCHAR ( wchar_t c ) { if ( unicode_status == UNICODE_ON ) { char buf [ MB_CUR_MAX + 1 ] ; mbstate_t mbst = { 0 } ; ssize_t len = wcrtomb ( buf , c , & mbst ) ; if ( len > 0 ) { buf [ len ] = ' \0 ' ; fputs ( buf , stdout ) ; } } else { putchar ( c ) ; } }
I thought just fputwc(c, stdout) would work.
I thought just fputwc ( c stdout ) would work .
/* In this case, c is always one byte */