Move always true ++lineptr out of while-condition

In core/file.c move ++lineptr out of the while condition
  !empty_string(lineptr) && (lineptr = strchr(lineptr, '\n') && ++lineptr
since it always evaluates to true.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-01-07 15:47:36 +01:00 committed by Lubomir I. Ivanov
parent 6a07ccbad2
commit c44224ed29

View file

@ -561,7 +561,8 @@ int parse_txt_file(const char *filename, const char *csv)
cur_cylinder_index++;
lineptr = strstr(memtxt.buffer, "Dive started at");
while (!empty_string(lineptr) && (lineptr = strchr(lineptr, '\n')) && ++lineptr) {
while (!empty_string(lineptr) && (lineptr = strchr(lineptr, '\n'))) {
++lineptr; // Skip over '\n'
key = next_mkvi_key(lineptr);
if (!key)
break;