0013-tload: Use snprintf() instead of sprintf().
This commit is contained in:
parent
39c3542754
commit
44593c5e99
4
tload.c
4
tload.c
@ -204,8 +204,8 @@ int main(int argc, char **argv)
|
||||
for (row = nrows - 2; row >= 0; --row)
|
||||
*(screen + row * ncols + col) = ' ';
|
||||
}
|
||||
i = sprintf(screen, " %.2f, %.2f, %.2f", av[0], av[1], av[2]);
|
||||
if (i > 0)
|
||||
i = snprintf(screen, scr_size, " %.2f, %.2f, %.2f", av[0], av[1], av[2]);
|
||||
if (i > 0 && i < scr_size)
|
||||
screen[i] = ' ';
|
||||
|
||||
if (write(fd, "\033[H", 3) < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user