diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-20 14:07:59 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-20 14:07:59 +0100 |
commit | fc9c67f5bee43127bba75d426ccb5b5ebd903c73 (patch) | |
tree | dc5ec851d1eb7fe6db10e0a547a2d7b904dcda65 /src/drivers/px4io/px4io.cpp | |
parent | 764f4994052e2e73fe7576c98d222d5d9cd3f352 (diff) | |
download | px4-firmware-fc9c67f5bee43127bba75d426ccb5b5ebd903c73.tar.gz px4-firmware-fc9c67f5bee43127bba75d426ccb5b5ebd903c73.tar.bz2 px4-firmware-fc9c67f5bee43127bba75d426ccb5b5ebd903c73.zip |
Fix CID 12439
Diffstat (limited to 'src/drivers/px4io/px4io.cpp')
-rw-r--r-- | src/drivers/px4io/px4io.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
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; + } } } |