mirror of
https://github.com/topjohnwu/ndk-busybox.git
synced 2024-11-25 12:49:54 +00:00
Terminate the buffer with a '\0'
This commit is contained in:
parent
0288c8e543
commit
ea12202288
@ -19,8 +19,10 @@
|
||||
|
||||
extern void data_extract_to_buffer(archive_handle_t *archive_handle)
|
||||
{
|
||||
archive_handle->buffer = xmalloc(archive_handle->file_header->size + 1);
|
||||
|
||||
archive_xread_all(archive_handle, archive_handle->buffer, archive_handle->file_header->size);
|
||||
const unsigned int size = archive_handle->file_header->size;
|
||||
|
||||
archive_handle->buffer = xmalloc(size + 1);
|
||||
|
||||
archive_xread_all(archive_handle, archive_handle->buffer, size);
|
||||
archive_handle->buffer[size] = '\0';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user