aboutsummaryrefslogtreecommitdiff
path: root/src/modules/navigator
diff options
context:
space:
mode:
authorBan Siesta <bansiesta@gmail.com>2014-12-21 14:09:04 +0000
committerBan Siesta <bansiesta@gmail.com>2014-12-21 14:09:04 +0000
commitb1f462a26638f252b0849083f1c3a81c52d49053 (patch)
tree4ea31d1cc24069d8d53135dc426a19b848ff8a8a /src/modules/navigator
parent1910b7e88be1bd92dc47e5b0457d50b0274f6297 (diff)
downloadpx4-firmware-b1f462a26638f252b0849083f1c3a81c52d49053.tar.gz
px4-firmware-b1f462a26638f252b0849083f1c3a81c52d49053.tar.bz2
px4-firmware-b1f462a26638f252b0849083f1c3a81c52d49053.zip
geofence: don't fall over lines containing just a LF
Diffstat (limited to 'src/modules/navigator')
-rw-r--r--src/modules/navigator/geofence.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/modules/navigator/geofence.cpp b/src/modules/navigator/geofence.cpp
index 0f431ded2..406137169 100644
--- a/src/modules/navigator/geofence.cpp
+++ b/src/modules/navigator/geofence.cpp
@@ -279,8 +279,14 @@ Geofence::loadFromFile(const char *filename)
while((textStart < sizeof(line)/sizeof(char)) && isspace(line[textStart])) textStart++;
/* if the line starts with #, skip */
- if (line[textStart] == commentChar)
+ if (line[textStart] == commentChar) {
continue;
+ }
+
+ /* if there is only a linefeed, skip it */
+ if (line[0] == '\n') {
+ continue;
+ }
if (gotVertical) {
/* Parse the line as a geofence point */