summaryrefslogtreecommitdiffstats
path: root/scripts/kernel-install.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-06-20 10:58:15 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-06-26 09:44:47 +0200
commitbbc70303c7166dbe8e72ea12fdc486c28a60c302 (patch)
tree9a13d53eac316f76b87fc20f24bf4bbbba1c88a7 /scripts/kernel-install.c
parent40d89c49777081ea88818610a575813d8a08e5c5 (diff)
downloadbarebox-bbc70303c7166dbe8e72ea12fdc486c28a60c302.tar.gz
barebox-bbc70303c7166dbe8e72ea12fdc486c28a60c302.tar.xz
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>
Diffstat (limited to 'scripts/kernel-install.c')
-rw-r--r--scripts/kernel-install.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/kernel-install.c b/scripts/kernel-install.c
index 459b45d864..d943f0288f 100644
--- a/scripts/kernel-install.c
+++ b/scripts/kernel-install.c
@@ -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;