summaryrefslogtreecommitdiffstats
path: root/core/parse-xml.c
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2017-08-07 20:39:33 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-08-10 09:09:53 -0700
commit366ad82a98fa8822b9b5b78342dc43a148ab7780 (patch)
tree6a28c91b02c3a23e0d8b8ce2f5c5fdef6f320801 /core/parse-xml.c
parent98e869d4f153a30f98d481125050a1b4ba39b9e4 (diff)
downloadsubsurface-366ad82a98fa8822b9b5b78342dc43a148ab7780.tar.gz
DLF: Restructure loop into a for loop
We always step forward 16 bytes, so make it a for loop so a continue won't throw us into a eternal loop. Signed-off-by: Anton Lundin <glance@acc.umu.se>
Diffstat (limited to 'core/parse-xml.c')
-rw-r--r--core/parse-xml.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/core/parse-xml.c b/core/parse-xml.c
index ef6f0bdfc..4b2d6a925 100644
--- a/core/parse-xml.c
+++ b/core/parse-xml.c
@@ -3549,7 +3549,7 @@ int parse_dlf_buffer(unsigned char *buffer, size_t size)
if (cur_dc->divemode == CCR || cur_dc->divemode == PSCR)
cur_dc->no_o2sensors = 1;
- while (ptr < buffer + size) {
+ for (; ptr < buffer + size; ptr += 16) {
time = ((ptr[0] >> 4) & 0x0f) +
((ptr[1] << 4) & 0xff0) +
((ptr[2] << 12) & 0x1f000);
@@ -3778,7 +3778,6 @@ int parse_dlf_buffer(unsigned char *buffer, size_t size)
/* Unknown... */
break;
}
- ptr += 16;
}
divecomputer_end();
dive_end();