diff options
author | entrpntr <entrpntr@gmail.com> | 2020-05-28 06:44:10 -0400 |
---|---|---|
committer | entrpntr <entrpntr@gmail.com> | 2020-06-14 15:07:27 -0400 |
commit | 4ac8bcc29a4ad5bb908b692baa040e7c7eb21249 (patch) | |
tree | d4e14bd6d9c367a1d5993dc9729451a3770f9870 /tools/lz/uncomp.c | |
parent | 4517c08edaa6783fac0fb15dd98b476e066134f8 (diff) |
Checkpoint where things mostly work.
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); } |