From fc9c67f5bee43127bba75d426ccb5b5ebd903c73 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 20 Jan 2015 14:07:59 +0100 Subject: Fix CID 12439 --- src/drivers/px4io/px4io.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/drivers') diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp index ed8f86fae..73204e220 100644 --- a/src/drivers/px4io/px4io.cpp +++ b/src/drivers/px4io/px4io.cpp @@ -3070,12 +3070,13 @@ lockdown(int argc, char *argv[]) if (ret > 0) { - read(0, &c, 1); + if (read(0, &c, 1) > 0) { - if (c != 'y') { - exit(0); - } else if (c == 'y') { - break; + if (c != 'y') { + exit(0); + } else if (c == 'y') { + break; + } } } -- cgit v1.2.3