summaryrefslogtreecommitdiffstats
path: root/uemis-downloader.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-11-19 20:50:39 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-11-19 20:50:39 -0800
commitcfaa4944527886e99bda8851b7a5d2f2c2e625f3 (patch)
tree77c0d6b42b232ac6f4eef7057a59cd5b28c266c9 /uemis-downloader.c
parentad0f91deca1a82f6ec4b53df966f9b50b64c8a78 (diff)
parent8e4d4970ecf348566046a5fd8aaee13a42b1a7e4 (diff)
downloadsubsurface-cfaa4944527886e99bda8851b7a5d2f2c2e625f3.tar.gz
Merge branch 'uemis-downloader-fixes'
Diffstat (limited to 'uemis-downloader.c')
-rw-r--r--uemis-downloader.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/uemis-downloader.c b/uemis-downloader.c
index 569f20353..fbab3dcef 100644
--- a/uemis-downloader.c
+++ b/uemis-downloader.c
@@ -388,7 +388,7 @@ static void buffer_insert(char **buffer, int *buffer_size, char *buf)
int obj_dive;
int obj_log;
int offset, len;
- uint8_t hdr[24];
+ uint8_t hdr[27];
/* since we want to insert into the buffer... if there's
* nothing there, this makes absolutely no sense so just
@@ -414,14 +414,14 @@ static void buffer_insert(char **buffer, int *buffer_size, char *buf)
* some info from that in order to make sense of the data in
* the dive info */
b64 = strstr(ptr, "<bin>") + 5;
- decode(b64, hdr, 32);
+ decode(b64, hdr, 36);
cbuf = convert_dive_details(buf, hdr);
offset = ptr - *buffer;
len = strlen(cbuf);
*buffer_size += len;
*buffer = realloc(*buffer, *buffer_size);
ptr = *buffer + offset;
- memmove(ptr + len, ptr, strlen(*buffer) - offset);
+ memmove(ptr + len, ptr, strlen(*buffer) - offset + 1);
memmove(ptr, cbuf, len);
}