[BusyBox-cvs] busybox/archival/libunarchive get_header_cpio.c,1.5,1.6

Erik Andersen andersen at codepoet.org
Wed Dec 11 21:45:11 UTC 2002


Update of /var/cvs/busybox/archival/libunarchive
In directory winder:/tmp/cvs-serv25788/archival/libunarchive

Modified Files:
	get_header_cpio.c 
Log Message:
A cleaner cleanup that avoids passing an off_t to scanf


Index: get_header_cpio.c
===================================================================
RCS file: /var/cvs/busybox/archival/libunarchive/get_header_cpio.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- get_header_cpio.c	11 Dec 2002 21:34:04 -0000	1.5
+++ get_header_cpio.c	11 Dec 2002 21:45:08 -0000	1.6
@@ -85,11 +85,15 @@
 		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 */




More information about the busybox-cvs mailing list