blob: 95cb8f576fb4dd79a9bd0970ae3095e5f888aeb4 [file] [log] [blame]
"Robert P. J. Day"63fc1a92006-07-02 19:47:05 +00001/* vi: set sw=4 ts=4: */
Glenn L McGrath237ae422002-11-03 14:05:15 +00002/*
Rob Landley1ec5b292006-05-29 07:42:02 +00003 * Copyright 2002 Glenn McGrath
Glenn L McGrath237ae422002-11-03 14:05:15 +00004 *
Rob Landley1ec5b292006-05-29 07:42:02 +00005 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
Glenn L McGrath237ae422002-11-03 14:05:15 +00006 */
7
Glenn L McGrath61b79042002-10-19 10:40:55 +00008#include "libbb.h"
Glenn L McGrath237ae422002-11-03 14:05:15 +00009#include "unarchive.h"
Glenn L McGrath61b79042002-10-19 10:40:55 +000010
Rob Landleydfba7412006-03-06 20:47:33 +000011void data_extract_to_buffer(archive_handle_t *archive_handle)
Glenn L McGrath61b79042002-10-19 10:40:55 +000012{
Glenn L McGrathea122022002-11-06 22:31:45 +000013 const unsigned int size = archive_handle->file_header->size;
Glenn L McGrath237ae422002-11-03 14:05:15 +000014
Rob Landley1ec5b292006-05-29 07:42:02 +000015 archive_handle->buffer = xzalloc(size + 1);
Glenn L McGrathea122022002-11-06 22:31:45 +000016
Rob Landley53437472006-07-16 08:14:35 +000017 xread(archive_handle->src_fd, archive_handle->buffer, size);
Glenn L McGrath61b79042002-10-19 10:40:55 +000018}