aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2002-12-11 21:45:08 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2002-12-11 21:45:08 +0000
commit3ce9460c42668efaeeba69c80647a92090402b81 (patch)
treebd785c0b3e2309f536c64a263d8194ea79510f37
parent6cca9ba7fbb0de0804f7cb1015a9045934ffdcf8 (diff)
downloadbusybox-w32-3ce9460c42668efaeeba69c80647a92090402b81.tar.gz
busybox-w32-3ce9460c42668efaeeba69c80647a92090402b81.tar.bz2
busybox-w32-3ce9460c42668efaeeba69c80647a92090402b81.zip
A cleaner cleanup that avoids passing an off_t to scanf
git-svn-id: svn://busybox.net/trunk/busybox@6179 69ca8d6d-28ef-0310-b511-8ec308f3f277
-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 96057a7b8..ea0857840 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)
85 error_msg_and_die("Unsupported cpio format, use newc or crc"); 85 error_msg_and_die("Unsupported cpio format, use newc or crc");
86 } 86 }
87 87
88 sscanf(cpio_header, "%6c%8x%8x%8x%8x%8x%8lx%8lx%16c%8x%8x%8x%8c", 88 {
89 dummy, &inode, (unsigned int*)&file_header->mode, 89 unsigned long tmpsize;
90 (unsigned int*)&file_header->uid, (unsigned int*)&file_header->gid, 90 sscanf(cpio_header, "%6c%8x%8x%8x%8x%8x%8lx%8lx%16c%8x%8x%8x%8c",
91 &nlink, &file_header->mtime, (unsigned long*)&file_header->size, 91 dummy, &inode, (unsigned int*)&file_header->mode,
92 dummy, &major, &minor, &namesize, dummy); 92 (unsigned int*)&file_header->uid, (unsigned int*)&file_header->gid,
93 &nlink, &file_header->mtime, &tmpsize,
94 dummy, &major, &minor, &namesize, dummy);
95 file_header->size = tmpsize;
96 }
93 97
94 file_header->name = (char *) xmalloc(namesize + 1); 98 file_header->name = (char *) xmalloc(namesize + 1);
95 archive_xread_all(archive_handle, file_header->name, namesize); /* Read in filename */ 99 archive_xread_all(archive_handle, file_header->name, namesize); /* Read in filename */