PERFORCE change 145844 for review

Anselm Strauss strauss at FreeBSD.org
Thu Jul 24 20:46:48 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=145844

Change 145844 by strauss at strauss_marvelman on 2008/07/24 20:45:57

	Aargh ... wrote some bytes over the void pointer ...

Affected files ...

.. //depot/projects/soc2008/strauss_libarchive/libarchive/archive_write_set_format_zip.c#17 edit
.. //depot/projects/soc2008/strauss_libarchive/libarchive/test/test_write_format_zip_no_compression.c#2 edit

Differences ...

==== //depot/projects/soc2008/strauss_libarchive/libarchive/archive_write_set_format_zip.c#17 (text+ko) ====

@@ -179,7 +179,7 @@
 	
 	/* Store the offset of this header for later use in central directory. */ 
 	l->offset = a->archive.raw_position;
-	
+
 	/* 
 	 * Formatting local file header.
 	 * Some fields are not explicitely set after they were set to 0
@@ -201,7 +201,7 @@
 	int64_t size = archive_entry_size(entry);
 	zip_encode(size, &d->compressed_size, sizeof(d->compressed_size));
 	zip_encode(size, &d->uncompressed_size, sizeof(d->uncompressed_size));
-
+	
 	ret = (a->compressor.write)(a, &h, sizeof(h));
 	if (ret != ARCHIVE_OK) return (ARCHIVE_FATAL);
 	
@@ -333,7 +333,7 @@
 {
 	unsigned char *p = (unsigned char *) _p;
 	size_t i;
-	for (i = 0; i <= size; ++i) {
+	for (i = 0; i < size; i++) {
 		*p = value & 0xff;
 		value >>= 8;
 		p++;

==== //depot/projects/soc2008/strauss_libarchive/libarchive/test/test_write_format_zip_no_compression.c#2 (text+ko) ====

@@ -23,7 +23,6 @@
 	
 	/* Regular file */
 	assert((entry = archive_entry_new()) != NULL);
-	archive_entry_set_mtime(entry, 1, 10);
 	archive_entry_set_pathname(entry, "file");
 	archive_entry_set_mode(entry, S_IFREG | 0664);
 	archive_entry_set_size(entry, 10);
@@ -37,7 +36,7 @@
 
 	/* Close out the archive . */
 	assertA(0 == archive_write_close(a));
-	//assertA(0 == archive_write_finish(a));
+	assertA(0 == archive_write_finish(a));
 
 	/* Verify the correct format for an empy Zip archive. */
 	//assertEqualInt(used, 22);


More information about the p4-projects mailing list