From owner-p4-projects@FreeBSD.ORG Thu Jul 24 20:46:48 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7477C1065679; Thu, 24 Jul 2008 20:46:48 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3779B106566B for ; Thu, 24 Jul 2008 20:46:48 +0000 (UTC) (envelope-from strauss@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 2E66D8FC31 for ; Thu, 24 Jul 2008 20:46:48 +0000 (UTC) (envelope-from strauss@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m6OKkliC017836 for ; Thu, 24 Jul 2008 20:46:47 GMT (envelope-from strauss@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m6OKklEo017834 for perforce@freebsd.org; Thu, 24 Jul 2008 20:46:47 GMT (envelope-from strauss@FreeBSD.org) Date: Thu, 24 Jul 2008 20:46:47 GMT Message-Id: <200807242046.m6OKklEo017834@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to strauss@FreeBSD.org using -f From: Anselm Strauss To: Perforce Change Reviews Cc: Subject: PERFORCE change 145844 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jul 2008 20:46:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=145844 Change 145844 by strauss@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);