Fix code assuming struct winsize fields are size_t.
This commit is contained in:
parent
8467102662
commit
e8a9d3dc04
|
@ -55,7 +55,7 @@ void tenth_last_column(void)
|
|||
tcgetwincurpos(1, &wcp);
|
||||
if ( wcp.wcp_col - ws.ws_col < 10 )
|
||||
printf("\n");
|
||||
printf("\e[%zuG", ws.ws_col - 10);
|
||||
printf("\e[%zuG", (size_t) (ws.ws_col - 10));
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
|
|
4
sh/sh.c
4
sh/sh.c
|
@ -95,9 +95,9 @@ void update_env(void)
|
|||
struct winsize ws;
|
||||
if ( tcgetwinsize(0, &ws) == 0 )
|
||||
{
|
||||
snprintf(str, sizeof(str), "%zu", ws.ws_col);
|
||||
snprintf(str, sizeof(str), "%zu", (size_t) ws.ws_col);
|
||||
setenv("COLUMNS", str, 1);
|
||||
snprintf(str, sizeof(str), "%zu", ws.ws_row);
|
||||
snprintf(str, sizeof(str), "%zu", (size_t) ws.ws_row);
|
||||
setenv("LINES", str, 1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue