summaryrefslogtreecommitdiffstats
path: root/core/qthelper.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-01-14 09:09:58 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-01-14 09:09:58 -0800
commit1ab6e7fc8a76bf68146e54c1c6a00b69955c9c9c (patch)
treee7844f2c7c773bb9231a009da077a3d8046dcac2 /core/qthelper.cpp
parentdd96f051694714f25cd0e3798bfacea3d1b6de49 (diff)
downloadsubsurface-1ab6e7fc8a76bf68146e54c1c6a00b69955c9c9c.tar.gz
Prevent crash on Mac when typing comma in GPS coordinates field
Our attempt to skip any white space after the comma causes an ASSERT (strangely only on Macs). This closes #158 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/qthelper.cpp')
-rw-r--r--core/qthelper.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/qthelper.cpp b/core/qthelper.cpp
index 1034316bb..f9e504ece 100644
--- a/core/qthelper.cpp
+++ b/core/qthelper.cpp
@@ -187,7 +187,7 @@ static bool parseCoord(const QString& txt, int& pos, const QString& positives,
(txt[pos] == ',' || txt[pos] == ';')) {
// next coordinate coming up
// eat the ',' and any subsequent white space
- while (txt[++pos].isSpace())
+ while (++pos < txt.size() && txt[pos].isSpace())
/* nothing */ ;
break;
} else {