summaryrefslogtreecommitdiffstats
path: root/libdivecomputer.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-11-21 21:42:00 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-11-21 21:42:00 -0800
commitacb8a0e118cd52a425163230610ece0ce29bae8b (patch)
treeb90546c9e793a1af94b0eb21e3d0a9d960b87468 /libdivecomputer.c
parent5437e9f6371195c6b16afa76e9027434fa51aca8 (diff)
downloadsubsurface-acb8a0e118cd52a425163230610ece0ce29bae8b.tar.gz
Add serial and firmware to the extra data
And add the missing newline to the debug output to help us identify encodings for serial and firmware. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'libdivecomputer.c')
-rw-r--r--libdivecomputer.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/libdivecomputer.c b/libdivecomputer.c
index fc1dad265..9004aa87f 100644
--- a/libdivecomputer.c
+++ b/libdivecomputer.c
@@ -382,9 +382,9 @@ static void parse_string_field(struct dive *dive, dc_field_string_t *str)
dive->dc.diveid = calculate_string_hash(str->value);
return;
}
-
+ add_extra_data(&dive->dc, str->desc, str->value);
if (!strcmp(str->desc, "Serial")) {
- fprintf(stderr, "string field \"Serial\": %s -- overwriting the existing serial of %s", str->value, dive->dc.serial);
+ fprintf(stderr, "string field \"Serial\": %s -- overwriting the existing serial of %s\n", str->value, dive->dc.serial);
dive->dc.serial = strdup(str->value);
/* should we just overwrite this whenever we have the "Serial" field?
* It's a much better deviceid then what we have so far... for now I'm leaving it as is */
@@ -392,14 +392,11 @@ static void parse_string_field(struct dive *dive, dc_field_string_t *str)
dive->dc.deviceid = calculate_string_hash(str->value);
return;
}
-
if (!strcmp(str->desc, "FW Version")) {
- fprintf(stderr, "string field \"FW Version\": %s -- overwriting the existing firware of %s", str->value, dive->dc.fw_version);
+ fprintf(stderr, "string field \"FW Version\": %s -- overwriting the existing firware of %s\n", str->value, dive->dc.fw_version);
dive->dc.fw_version = strdup(str->value);
return;
}
-
- add_extra_data(&dive->dc, str->desc, str->value);
}
#endif