summaryrefslogtreecommitdiff
path: root/pkgtools/pkg_filecheck/files
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2006-10-24 19:23:38 +0000
committerrillig <rillig@pkgsrc.org>2006-10-24 19:23:38 +0000
commit7a70e6ce93af4cd8b53d5e455fec76a997c4bb40 (patch)
treee62ee19847529f27cab44a2de3032c1dc6d27cbb /pkgtools/pkg_filecheck/files
parenteb3a34f0bb2892d06225149094089f5080d5e711 (diff)
downloadpkgsrc-7a70e6ce93af4cd8b53d5e455fec76a997c4bb40.tar.gz
Updated pkg_filecheck to 0.3.
Bugfix: When allocating more memory, it does not help to double the amount if the current amount is zero.
Diffstat (limited to 'pkgtools/pkg_filecheck/files')
-rw-r--r--pkgtools/pkg_filecheck/files/pkg_filecheck.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/pkgtools/pkg_filecheck/files/pkg_filecheck.c b/pkgtools/pkg_filecheck/files/pkg_filecheck.c
index 46e45b13582..6bc3a8f73ae 100644
--- a/pkgtools/pkg_filecheck/files/pkg_filecheck.c
+++ b/pkgtools/pkg_filecheck/files/pkg_filecheck.c
@@ -1,5 +1,5 @@
/*
- $NetBSD: pkg_filecheck.c,v 1.3 2006/07/02 10:32:09 rillig Exp $
+ $NetBSD: pkg_filecheck.c,v 1.4 2006/10/24 19:23:38 rillig Exp $
pkg_filecheck.c -- check for files not owned by any package
Copyright (C) 2001 Dieter Baron
@@ -302,10 +302,9 @@ push(struct array *a, void *el)
void *p;
if (a->len + 2 > a->alen) {
- if (a->alen > 1024)
- alen = a->alen+1024;
- else
- alen = a->alen * 2;
+ alen = (a->alen == 0) ? 8
+ : (a->alen < 1024) ? (a->alen * 2)
+ : (a->alen + 1024);
if ((p=realloc(a->p, alen*sizeof(void *))) == NULL) {
fprintf(stderr, "%s: malloc failure\n", prg);