diff options
author | IIMarckus <iimarckus@gmail.com> | 2020-06-28 23:29:04 -0600 |
---|---|---|
committer | IIMarckus <iimarckus@gmail.com> | 2020-06-28 23:29:04 -0600 |
commit | 9dbe676f445210aaaa6eedcd805cbb65318ac77f (patch) | |
tree | 26c817df24e358e67cf05e1833ffb7a409173515 /tools/lz/uncomp.c | |
parent | 152efaadc014b3095e087a5375c76be1fb1a9da0 (diff) | |
parent | c1fc2368c605e7db7d23de43e74d6e8040f94dd7 (diff) |
Merge branch 'master' of https://github.com/aaaaaa123456789/pokegold
Diffstat (limited to 'tools/lz/uncomp.c')
-rw-r--r-- | tools/lz/uncomp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/lz/uncomp.c b/tools/lz/uncomp.c index 3544cd93..b22fc75f 100644 --- a/tools/lz/uncomp.c +++ b/tools/lz/uncomp.c @@ -49,7 +49,7 @@ struct command * get_commands_from_file (const unsigned char * data, unsigned sh } if (slack) *slack = *size - (rp - data); *size = current - result; - return realloc(result, *size * sizeof(struct command)); + return realloc(result, (*size ? *size : 1) * sizeof(struct command)); error: free(result); return NULL; @@ -88,5 +88,5 @@ unsigned char * get_uncompressed_data (const struct command * commands, const un } } *size = current - result; - return result; + return realloc(result, *size ? *size : 1); } |