aboutsummaryrefslogtreecommitdiff
path: root/archival/libunarchive/data_extract_to_buffer.c
diff options
context:
space:
mode:
authorbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2002-11-06 22:31:45 +0000
committerbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2002-11-06 22:31:45 +0000
commit42ed2377e910fb7ac912d9793f30b711a464362c (patch)
tree590f8d0f47e84dc5663e8afdf9781da1f0ed749a /archival/libunarchive/data_extract_to_buffer.c
parentb9c9f19e2fe7dee6badf9f8966f1e00a7ad44594 (diff)
downloadbusybox-w32-42ed2377e910fb7ac912d9793f30b711a464362c.tar.gz
busybox-w32-42ed2377e910fb7ac912d9793f30b711a464362c.tar.bz2
busybox-w32-42ed2377e910fb7ac912d9793f30b711a464362c.zip
Terminate the buffer with a '\0'
git-svn-id: svn://busybox.net/trunk/busybox@5831 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'archival/libunarchive/data_extract_to_buffer.c')
-rw-r--r--archival/libunarchive/data_extract_to_buffer.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/archival/libunarchive/data_extract_to_buffer.c b/archival/libunarchive/data_extract_to_buffer.c
index 3fcab6d02..db5521bcb 100644
--- a/archival/libunarchive/data_extract_to_buffer.c
+++ b/archival/libunarchive/data_extract_to_buffer.c
@@ -19,8 +19,10 @@
19 19
20extern void data_extract_to_buffer(archive_handle_t *archive_handle) 20extern void data_extract_to_buffer(archive_handle_t *archive_handle)
21{ 21{
22 archive_handle->buffer = xmalloc(archive_handle->file_header->size + 1); 22 const unsigned int size = archive_handle->file_header->size;
23
24 archive_xread_all(archive_handle, archive_handle->buffer, archive_handle->file_header->size);
25 23
24 archive_handle->buffer = xmalloc(size + 1);
25
26 archive_xread_all(archive_handle, archive_handle->buffer, size);
27 archive_handle->buffer[size] = '\0';
26} 28}