Ensure argument to printsys() is always nul terminated

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg 2021-05-06 10:03:01 +02:00
parent 52fc3f7176
commit ebced817a7

View File

@ -554,9 +554,12 @@ static void kernel_cb(int fd, void *arg)
if (len > 0) if (len > 0)
memmove(line, p, len + 1); memmove(line, p, len + 1);
} }
if (len > 0)
if (len > 0) {
line[len] = 0;
printsys(line); printsys(line);
} }
}
static int opensys(const char *file) static int opensys(const char *file)
{ {