blob: 3eaca98b3377faf0114d3f1e91fa7d9614a9c183 [file] [log] [blame]
Glenn L McGrath237ae422002-11-03 14:05:15 +00001/*
Rob Landley1ec5b292006-05-29 07:42:02 +00002 * Copyright 2002 Glenn McGrath
Glenn L McGrath237ae422002-11-03 14:05:15 +00003 *
Rob Landley1ec5b292006-05-29 07:42:02 +00004 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
Glenn L McGrath237ae422002-11-03 14:05:15 +00005 */
6
Glenn L McGrath61b79042002-10-19 10:40:55 +00007#include "libbb.h"
Glenn L McGrath237ae422002-11-03 14:05:15 +00008#include "unarchive.h"
Glenn L McGrath61b79042002-10-19 10:40:55 +00009
Rob Landleydfba7412006-03-06 20:47:33 +000010void data_extract_to_buffer(archive_handle_t *archive_handle)
Glenn L McGrath61b79042002-10-19 10:40:55 +000011{
Glenn L McGrathea122022002-11-06 22:31:45 +000012 const unsigned int size = archive_handle->file_header->size;
Glenn L McGrath237ae422002-11-03 14:05:15 +000013
Rob Landley1ec5b292006-05-29 07:42:02 +000014 archive_handle->buffer = xzalloc(size + 1);
Glenn L McGrathea122022002-11-06 22:31:45 +000015
16 archive_xread_all(archive_handle, archive_handle->buffer, size);
Glenn L McGrath61b79042002-10-19 10:40:55 +000017}