mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 05:52:48 +07:00
initctl: Minor, use local screen_cols rather than SCREEN_WIDTH
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
+3
-3
@@ -64,7 +64,7 @@ static void do_list(const char *heading, const char *path)
|
||||
{
|
||||
int num;
|
||||
int width;
|
||||
char buf[SCREEN_WIDTH];
|
||||
char buf[screen_cols];
|
||||
size_t i, len;
|
||||
glob_t gl;
|
||||
|
||||
@@ -85,8 +85,8 @@ static void do_list(const char *heading, const char *path)
|
||||
printf("\e[1m%s\e[0m\n", buf);
|
||||
|
||||
width = calc_width(gl.gl_pathv, gl.gl_pathc);
|
||||
num = SCREEN_WIDTH / width;
|
||||
if ((num - 1) * 2 + num * width > SCREEN_WIDTH)
|
||||
num = (screen_cols - 2) / width;
|
||||
if ((num - 1) * 2 + num * width > screen_cols)
|
||||
num--;
|
||||
|
||||
for (i = 0; i < gl.gl_pathc; i++) {
|
||||
|
||||
Reference in New Issue
Block a user