/*
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#include <sys/types.h>

#include <errno.h>
#include <unistd.h>

#include "libbb.h"
#include "unarchive.h"

extern void data_align(archive_handle_t *archive_handle, const unsigned short boundary)
{
	const unsigned short skip_amount = (boundary - (archive_handle->offset % boundary)) % boundary;

	archive_handle->seek(archive_handle, skip_amount);

	archive_handle->offset += skip_amount;

	return;
}
