Skip to content

Commit 156fff2

Browse files
committed
Use macro to check special chars for tty-resizer
1 parent b89ca46 commit 156fff2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tty-resizer/tty-resizer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ int on_char_received(void *ctx, void *data, size_t size){
4646
struct winsize ws;
4747

4848
ch = *(char *)data;
49-
if(ch == 't'){
49+
if(ch == RESIZER_END_MARKER){
5050
ringbuf_received[ringbuf_received_idx] = '\0';
5151
if(sscanf(ringbuf_received, "%hu" RESIZER_SEPARATOR "%hu", &ws.ws_row, &ws.ws_col) == 2){
5252
int tty_fd = open(ttypath, O_RDONLY | O_NOCTTY);
@@ -62,7 +62,7 @@ int on_char_received(void *ctx, void *data, size_t size){
6262
}
6363
ringbuf_received_idx = 0;
6464
}
65-
else if(ch == 'c'){
65+
else if(ch == RESIZER_CANCEL_MARKER){
6666
ringbuf_received_idx = 0;
6767
}
6868
else{

0 commit comments

Comments
 (0)