diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2012-09-27 00:16:42 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2012-09-27 00:29:31 -0700 |
commit | bd3df859bcc08965bde4f38ca094e1191ad83bbd (patch) | |
tree | 0b7c0cd970c48b3b3adb52f43df8c97e4b1ec14a /gtk-gui.c | |
parent | 58ba24b84eda600a4e286d7849207afb03e56e10 (diff) | |
download | subsurface-bd3df859bcc08965bde4f38ca094e1191ad83bbd.tar.gz |
Restructure the Uemis native download buffer code
Running under Valgrind showed a couple of silly bugs.
Worse, intentionally running into various error scenarios showed that we
could get the buffer handling in the raw parsing code to break down - we
would fail to process the correctly downloaded files.
To make it easier to get this right I restructured the code to collect the
XML buffer in a different way - this works much better and has stood up
well under testing so far.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'gtk-gui.c')
-rw-r--r-- | gtk-gui.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1256,7 +1256,7 @@ static int fill_computer_list(GtkListStore *store) THIS IS A HACK as we use the internal of libdivecomputer data structures... eventually the UEMIS code needs to move into libdivecomputer, I guess */ - mydescriptor = malloc(sizeof(mydescriptor)); + mydescriptor = malloc(sizeof(struct mydescriptor)); mydescriptor->vendor = "Uemis"; mydescriptor->product = "Zurich"; mydescriptor->type = DC_FAMILY_NULL; @@ -1415,7 +1415,7 @@ void import_files(GtkWidget *w, gpointer data) static GError *setup_uemis_import(device_data_t *data) { GError *error = NULL; - char *buf; + char *buf = NULL; error = uemis_download(data->devname, &uemis_max_dive_data, &buf, &data->progress); if (buf && strlen(buf) > 1) { |