diff options
author | Guillem Jover <guillem@debian.org> | 2010-12-31 12:43:21 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2011-01-08 17:17:40 +0100 |
commit | 150be4c45af785a6374e2c7ecc90b0fdab054787 (patch) | |
tree | c313caf8c35937e61c8c4ab06f69167392e74a2c /dpkg-split | |
parent | 6a790ffc469be94173db8dc0f0ebee7e9c95e707 (diff) | |
download | dpkg-150be4c45af785a6374e2c7ecc90b0fdab054787.tar.gz |
dpkg-split: Use number of parts to track split process
Use the currently available variables instead of the additional useless
startat.
Diffstat (limited to 'dpkg-split')
-rw-r--r-- | dpkg-split/split.c | 6 |
1 files changed, 1 insertions, 5 deletions
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); |