Hide degree character without wide ncurses support

This commit is contained in:
Christian Göttsche 2020-12-04 16:09:44 +01:00 committed by BenBE
parent f0a9dfc37e
commit f913680020
1 changed files with 1 additions and 1 deletions

2
CRT.c
View File

@ -80,13 +80,13 @@ static const char* initDegreeSign(void) {
#ifdef HAVE_LIBNCURSESW
if (CRT_utf8)
return "\xc2\xb0";
#endif
static char buffer[4];
// this might fail if the current locale does not support wide characters
int r = snprintf(buffer, sizeof(buffer), "%lc", 176);
if (r > 0)
return buffer;
#endif
return "";
}