summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2019-03-18 20:54:18 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-03-18 19:40:32 -0700
commit34bddaf3a8035be45a43e03e1b907c171c2802c7 (patch)
treefaf6eb92cf400559f0c330f828636dbda746570e
parent79df0ded3cfe5dee7c26c40933f0ee3bc98d0322 (diff)
downloadsubsurface-34bddaf3a8035be45a43e03e1b907c171c2802c7.tar.gz
Core: fix another variable name conflict
Addresses LGTM.com issue. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--core/parse-xml.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/core/parse-xml.c b/core/parse-xml.c
index d779d3e56..c2e2ef937 100644
--- a/core/parse-xml.c
+++ b/core/parse-xml.c
@@ -2137,19 +2137,19 @@ int parse_dlf_buffer(unsigned char *buffer, size_t size, struct dive_table *tabl
/* Recording the starting battery status to extra data */
if (battery_start.volt1) {
- size_t size = snprintf(NULL, 0, "%dmV (%d%%)", battery_start.volt1, battery_start.percent1) + 1;
+ size_t stringsize = snprintf(NULL, 0, "%dmV (%d%%)", battery_start.volt1, battery_start.percent1) + 1;
char *ptr = malloc(size);
if (ptr) {
- snprintf(ptr, size, "%dmV (%d%%)", battery_start.volt1, battery_start.percent1);
+ snprintf(ptr, stringsize, "%dmV (%d%%)", battery_start.volt1, battery_start.percent1);
add_extra_data(state.cur_dc, "Battery 1 (start)", ptr);
free(ptr);
}
- size = snprintf(NULL, 0, "%dmV (%d%%)", battery_start.volt2, battery_start.percent2) + 1;
- ptr = malloc(size);
+ stringsize = snprintf(NULL, 0, "%dmV (%d%%)", battery_start.volt2, battery_start.percent2) + 1;
+ ptr = malloc(stringsize);
if (ptr) {
- snprintf(ptr, size, "%dmV (%d%%)", battery_start.volt2, battery_start.percent2);
+ snprintf(ptr, stringsize, "%dmV (%d%%)", battery_start.volt2, battery_start.percent2);
add_extra_data(state.cur_dc, "Battery 2 (start)", ptr);
free(ptr);
}
@@ -2157,19 +2157,19 @@ int parse_dlf_buffer(unsigned char *buffer, size_t size, struct dive_table *tabl
/* Recording the ending battery status to extra data */
if (battery_end.volt1) {
- size_t size = snprintf(NULL, 0, "%dmV (%d%%)", battery_end.volt1, battery_end.percent1) + 1;
- char *ptr = malloc(size);
+ size_t stringsize = snprintf(NULL, 0, "%dmV (%d%%)", battery_end.volt1, battery_end.percent1) + 1;
+ char *ptr = malloc(stringsize);
if (ptr) {
- snprintf(ptr, size, "%dmV (%d%%)", battery_end.volt1, battery_end.percent1);
+ snprintf(ptr, stringsize, "%dmV (%d%%)", battery_end.volt1, battery_end.percent1);
add_extra_data(state.cur_dc, "Battery 1 (end)", ptr);
free(ptr);
}
- size = snprintf(NULL, 0, "%dmV (%d%%)", battery_end.volt2, battery_end.percent2) + 1;
- ptr = malloc(size);
+ stringsize = snprintf(NULL, 0, "%dmV (%d%%)", battery_end.volt2, battery_end.percent2) + 1;
+ ptr = malloc(stringsize);
if (ptr) {
- snprintf(ptr, size, "%dmV (%d%%)", battery_end.volt2, battery_end.percent2);
+ snprintf(ptr, stringsize, "%dmV (%d%%)", battery_end.volt2, battery_end.percent2);
add_extra_data(state.cur_dc, "Battery 2 (end)", ptr);
free(ptr);
}