9
0
Fork 0

kernel-install: fix return value check for getline

getline returns the number of characters read, so check for
ret < 0 instead of ret.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2014-06-20 10:58:15 +02:00
parent 40d89c4977
commit bbc70303c7
1 changed files with 1 additions and 1 deletions

View File

@ -1026,7 +1026,7 @@ static int do_remove_kernel(void)
do_list_entries();
printf("which kernel do you like to remove?\n");
ret = getline(&input, &insize, stdin);
if (ret)
if (ret < 0)
return -errno;
if (!strlen(input))
return -EINVAL;