Update lzcomp

This commit is contained in:
aaaaaa123456789
2020-06-28 05:20:05 -03:00
parent 73d20afd15
commit 267352c4d8
3 changed files with 13 additions and 5 deletions

View File

@@ -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);
}