parser: fix char-not-found checks in import-csv.c

These were two weird and clearly wrong constructs of the
type "if (iter && iter + 1)", where iter is a pointer. This
is always true at best and undefined at worst. Another
instance was removed in 096de0efd0.

The original code probably wanted to check whether the
found character was the last character in the string.
But that likewise seems to make no particular sense in
this context. Therefore, just remove the second part of
the boolean expression.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2023-02-05 00:56:16 +01:00 committed by bstoeger
parent 1e3d378ad9
commit 7b44689c8e

View file

@ -178,7 +178,7 @@ static int parse_dan_format(const char *filename, struct xml_params *params, str
memset(tmpbuf, 0, sizeof(tmpbuf)); memset(tmpbuf, 0, sizeof(tmpbuf));
iter = strchr(iter, '|'); iter = strchr(iter, '|');
if (iter && iter[1]) { if (iter) {
iter = iter + 1; iter = iter + 1;
iter_end = strchr(iter, '|'); iter_end = strchr(iter, '|');
@ -203,7 +203,7 @@ static int parse_dan_format(const char *filename, struct xml_params *params, str
for (i = 0; i < 5 && iter; ++i) for (i = 0; i < 5 && iter; ++i)
iter = strchr(iter + 1, '|'); iter = strchr(iter + 1, '|');
if (iter && iter + 1) { if (iter) {
iter = iter + 1; iter = iter + 1;
iter_end = strchr(iter, '|'); iter_end = strchr(iter, '|');
@ -254,7 +254,7 @@ static int parse_dan_format(const char *filename, struct xml_params *params, str
for (i = 0; i < 5 && iter; ++i) for (i = 0; i < 5 && iter; ++i)
iter = strchr(iter + 1, '|'); iter = strchr(iter + 1, '|');
if (iter && iter + 1) { if (iter) {
iter = iter + 1; iter = iter + 1;
iter_end = strchr(iter, '|'); iter_end = strchr(iter, '|');