[ncwidth] error-check printfs #2691

This commit is contained in:
nick black 2022-12-17 14:10:34 -05:00
parent 040ff99fb7
commit 09f7b717ac
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -28,12 +28,18 @@ defaultout(void){
for(int i = 0 ; i < 128 ; ++i){
wint_t w = i;
int width = wcwidth(w);
printf("0x%02x: %d%c\t", w, width, width < 0 ? '!' : ' ');
if(printf("0x%02x: %d%c\t", w, width, width < 0 ? '!' : ' ') < 0){
return -1;
}
if(i % 4 == 3){
printf("\n");
if(printf("\n") < 0){
return -1;
}
}
}
printf("\n");
if(printf("\n") < 0){
return -1;
}
return 0;
}