aboutsummaryrefslogtreecommitdiff
path: root/lib/tar/src/padd_file.c
blob: 814b66651b0f7798b54c00358984db5b032db072 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* SPDX-License-Identifier: GPL-3.0-or-later */
/*
 * padd_file.c
 *
 * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>
 */
#include "config.h"
#include "tar/tar.h"
#include "tar/format.h"

int padd_file(sqfs_ostream_t *fp, sqfs_u64 size)
{
	size_t padd_sz = size % TAR_RECORD_SIZE;

	if (padd_sz == 0)
		return 0;

	return fp->append(fp, NULL, TAR_RECORD_SIZE - padd_sz);
}