summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen2002-12-11 21:45:08 +0000
committerEric Andersen2002-12-11 21:45:08 +0000
commitf4b273cbb417dfb6cca1bbd67b40bf7ef30c677c (patch)
treebd785c0b3e2309f536c64a263d8194ea79510f37
parent9f4395c54e9e5507f2a59643f62bb42ef2601aab (diff)
downloadbusybox-f4b273cbb417dfb6cca1bbd67b40bf7ef30c677c.zip
busybox-f4b273cbb417dfb6cca1bbd67b40bf7ef30c677c.tar.gz
A cleaner cleanup that avoids passing an off_t to scanf
-rw-r--r--archival/libunarchive/get_header_cpio.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/archival/libunarchive/get_header_cpio.c b/archival/libunarchive/get_header_cpio.c
index 96057a7..ea08578 100644
--- a/archival/libunarchive/get_header_cpio.c
+++ b/archival/libunarchive/get_header_cpio.c
@@ -85,11 +85,15 @@ extern char get_header_cpio(archive_handle_t *archive_handle)
error_msg_and_die("Unsupported cpio format, use newc or crc");
}
- sscanf(cpio_header, "%6c%8x%8x%8x%8x%8x%8lx%8lx%16c%8x%8x%8x%8c",
- dummy, &inode, (unsigned int*)&file_header->mode,
- (unsigned int*)&file_header->uid, (unsigned int*)&file_header->gid,
- &nlink, &file_header->mtime, (unsigned long*)&file_header->size,
- dummy, &major, &minor, &namesize, dummy);
+ {
+ unsigned long tmpsize;
+ sscanf(cpio_header, "%6c%8x%8x%8x%8x%8x%8lx%8lx%16c%8x%8x%8x%8c",
+ dummy, &inode, (unsigned int*)&file_header->mode,
+ (unsigned int*)&file_header->uid, (unsigned int*)&file_header->gid,
+ &nlink, &file_header->mtime, &tmpsize,
+ dummy, &major, &minor, &namesize, dummy);
+ file_header->size = tmpsize;
+ }
file_header->name = (char *) xmalloc(namesize + 1);
archive_xread_all(archive_handle, file_header->name, namesize); /* Read in filename */