test::reset_terminal(): properly check tigetstr()

pull/632/head
nick black 4 years ago
parent eb72a4612d
commit b7a9b11f0c
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -58,12 +58,12 @@ reset_terminal(){
tcsetattr(fd, TCSADRAIN, &tios); tcsetattr(fd, TCSADRAIN, &tios);
} }
char* str = tigetstr("sgr0"); char* str = tigetstr("sgr0");
if(str){ if(str != (char*)-1){
printf("%s", str); printf("%s", str);
} }
fflush(stdout); fflush(stdout);
str = tigetstr("oc"); str = tigetstr("oc");
if(str){ if(str != (char*)-1){
printf("%s", str); printf("%s", str);
} }
fflush(stdout); fflush(stdout);

Loading…
Cancel
Save