mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
f85e406855
commit
3f707256d9
1 changed files with 1 additions and 5 deletions
|
@ -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)
|
int try_to_open_liquivision(const char *filename, struct memblock *mem)
|
||||||
{
|
{
|
||||||
void *name;
|
|
||||||
const unsigned char *buf = mem->buffer;
|
const unsigned char *buf = mem->buffer;
|
||||||
unsigned int buf_size = mem->size;
|
unsigned int buf_size = mem->size;
|
||||||
unsigned int ptr;
|
unsigned int ptr;
|
||||||
|
@ -345,10 +344,7 @@ int try_to_open_liquivision(const char *filename, struct memblock *mem)
|
||||||
|
|
||||||
// Get name
|
// Get name
|
||||||
unsigned int len = array_uint32_le(buf);
|
unsigned int len = array_uint32_le(buf);
|
||||||
if (len) {
|
// Ignore name
|
||||||
name = malloc(len);
|
|
||||||
strncpy(name, buf + 4, len);
|
|
||||||
}
|
|
||||||
ptr = 4 + len;
|
ptr = 4 + len;
|
||||||
|
|
||||||
unsigned int dive_count = array_uint32_le(buf + ptr);
|
unsigned int dive_count = array_uint32_le(buf + ptr);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue