summaryrefslogtreecommitdiffstats
path: root/lib/libarchive
diff options
context:
space:
mode:
authorcperciva <cperciva@FreeBSD.org>2007-05-22 15:37:58 +0000
committercperciva <cperciva@FreeBSD.org>2007-05-22 15:37:58 +0000
commit00c45ba7c0daf537e350850940c71ae1660944eb (patch)
treef1616a5f6a2d77dbfb96c516dcde6d015bd5f45b /lib/libarchive
parent4c4fb12e78e41c0f9e589df3eb8d4750dc66734e (diff)
downloadFreeBSD-src-00c45ba7c0daf537e350850940c71ae1660944eb.zip
FreeBSD-src-00c45ba7c0daf537e350850940c71ae1660944eb.tar.gz
Replace "sizeof(struct bucket[cache_size])" with
"cache_size * sizeof(struct bucket)". The former is valid in C99 but can confuse earlier compilers, while the latter is a standard idiom which all C compilers understand. Approved by: kientzle
Diffstat (limited to 'lib/libarchive')
-rw-r--r--lib/libarchive/archive_write_disk_set_standard_lookup.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libarchive/archive_write_disk_set_standard_lookup.c b/lib/libarchive/archive_write_disk_set_standard_lookup.c
index f9bad27..25c8b86 100644
--- a/lib/libarchive/archive_write_disk_set_standard_lookup.c
+++ b/lib/libarchive/archive_write_disk_set_standard_lookup.c
@@ -100,10 +100,10 @@ static void cleanup(void *);
int
archive_write_disk_set_standard_lookup(struct archive *a)
{
- struct bucket *ucache = malloc(sizeof(struct bucket[cache_size]));
- struct bucket *gcache = malloc(sizeof(struct bucket[cache_size]));
- memset(ucache, 0, sizeof(struct bucket[cache_size]));
- memset(gcache, 0, sizeof(struct bucket[cache_size]));
+ struct bucket *ucache = malloc(cache_size * sizeof(struct bucket));
+ struct bucket *gcache = malloc(cache_size * sizeof(struct bucket));
+ memset(ucache, 0, cache_size * sizeof(struct bucket));
+ memset(gcache, 0, cache_size * sizeof(struct bucket));
archive_write_disk_set_group_lookup(a, gcache, lookup_gid, cleanup);
archive_write_disk_set_user_lookup(a, ucache, lookup_uid, cleanup);
return (ARCHIVE_OK);
OpenPOWER on IntegriCloud