Removed liquivision unneeded variable and potential segfault.

Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
John Van Ostrand 2014-11-09 13:03:06 -05:00 committed by Dirk Hohndel
parent f85e406855
commit 3f707256d9

View file

@ -337,7 +337,6 @@ static void parse_dives (int log_version, const unsigned char *buf, unsigned int
int try_to_open_liquivision(const char *filename, struct memblock *mem)
{
void *name;
const unsigned char *buf = mem->buffer;
unsigned int buf_size = mem->size;
unsigned int ptr;
@ -345,10 +344,7 @@ int try_to_open_liquivision(const char *filename, struct memblock *mem)
// Get name
unsigned int len = array_uint32_le(buf);
if (len) {
name = malloc(len);
strncpy(name, buf + 4, len);
}
// Ignore name
ptr = 4 + len;
unsigned int dive_count = array_uint32_le(buf + ptr);