mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
c90352008b
commit
096de0efd0
1 changed files with 1 additions and 1 deletions
|
@ -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[1]) {
|
||||||
iter = iter + 1;
|
iter = iter + 1;
|
||||||
iter_end = strchr(iter, '|');
|
iter_end = strchr(iter, '|');
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue