Skip to content

Commit 9097542

Browse files
use sizeof for getting the command buffer size
1 parent adcb7e1 commit 9097542

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/internal.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,9 +1097,10 @@ static int WS_TermResize(WOLFSSH* ssh, word32 col, word32 row, word32 colP,
10971097

10981098
if (term != NULL) {
10991099
char cmd[30]; /* 2 int values (11 chars max) plus \x1b[8 ; t */
1100-
int cmdSz = 30;
1100+
int cmdSz;
11011101
DWORD wrtn = 0;
11021102

1103+
cmdSz = (int)sizeof(cmd);
11031104
/* VT control sequence for resizing window */
11041105
cmdSz = snprintf(cmd, cmdSz, "\x1b[8;%d;%dt", row, col);
11051106
if (cmdSz < 0 || cmdSz >= sizeof(cmd)) {

0 commit comments

Comments
 (0)