aboutsummaryrefslogtreecommitdiffstats
path: root/core/import-csv.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2021-07-23 11:27:49 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-07-23 11:30:17 -0700
commit096de0efd01e12de6c4ce968eead90e95ff8157f (patch)
treec8258e34d28729782ecbfb5475462be7ddb3b911 /core/import-csv.c
parentc90352008b22819ff903982c96d78bca108a06c4 (diff)
downloadsubsurface-096de0efd01e12de6c4ce968eead90e95ff8157f.tar.gz
core/import: fix string check logic
The intent of the code was to check that there is a string and it has at least two characters. Since iter is the result of a strchr(iter, '|') call, we know that if iter isn't NULL, iter[0] is '|', so we only need to check the next character. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/import-csv.c')
-rw-r--r--core/import-csv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/import-csv.c b/core/import-csv.c
index 34ac1348b..84ab627c2 100644
--- a/core/import-csv.c
+++ b/core/import-csv.c
@@ -178,7 +178,7 @@ static int parse_dan_format(const char *filename, struct xml_params *params, str
memset(tmpbuf, 0, sizeof(tmpbuf));
iter = strchr(iter, '|');
- if (iter && iter + 1) {
+ if (iter && iter[1]) {
iter = iter + 1;
iter_end = strchr(iter, '|');