Commit e8a9d3dc authored by Jonas Termansen's avatar Jonas Termansen

Fix code assuming struct winsize fields are size_t.

parent 84671026
......@@ -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);
}
......
......@@ -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);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment