From 150be4c45af785a6374e2c7ecc90b0fdab054787 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Fri, 31 Dec 2010 12:43:21 +0100 Subject: dpkg-split: Use number of parts to track split process Use the currently available variables instead of the additional useless startat. --- dpkg-split/split.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'dpkg-split') diff --git a/dpkg-split/split.c b/dpkg-split/split.c index 6c62b0654..91f069a33 100644 --- a/dpkg-split/split.c +++ b/dpkg-split/split.c @@ -118,7 +118,6 @@ mksplit(const char *file_src, const char *prefix, size_t partsize, char hash[MD5HASHLEN + 1]; char *package, *version; int nparts, curpart; - off_t startat; char *prefixdir = NULL, *msdos_prefix = NULL; struct varbuf file_dst = VARBUF_INIT; struct varbuf partmagic = VARBUF_INIT; @@ -161,9 +160,8 @@ mksplit(const char *file_src, const char *prefix, size_t partsize, } partdata = m_malloc(partsize); - curpart = 1; - for (startat = 0; startat < st.st_size; startat += partsize) { + for (curpart = 1; curpart <= nparts; curpart++) { int fd_dst; ssize_t partrealsize; @@ -221,8 +219,6 @@ mksplit(const char *file_src, const char *prefix, size_t partsize, close(fd_dst); printf("%d ", curpart); - - curpart++; } varbuf_destroy(&file_dst); -- cgit v1.2.3