diff options
author | rillig <rillig@pkgsrc.org> | 2006-10-24 19:23:38 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2006-10-24 19:23:38 +0000 |
commit | 7a70e6ce93af4cd8b53d5e455fec76a997c4bb40 (patch) | |
tree | e62ee19847529f27cab44a2de3032c1dc6d27cbb | |
parent | eb3a34f0bb2892d06225149094089f5080d5e711 (diff) | |
download | pkgsrc-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.
-rw-r--r-- | pkgtools/pkg_filecheck/Makefile | 4 | ||||
-rw-r--r-- | pkgtools/pkg_filecheck/files/pkg_filecheck.c | 9 |
2 files changed, 6 insertions, 7 deletions
diff --git a/pkgtools/pkg_filecheck/Makefile b/pkgtools/pkg_filecheck/Makefile index 07cdf180dcb..245efafbb04 100644 --- a/pkgtools/pkg_filecheck/Makefile +++ b/pkgtools/pkg_filecheck/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.23 2006/10/24 18:19:22 rillig Exp $ +# $NetBSD: Makefile,v 1.24 2006/10/24 19:23:38 rillig Exp $ # -DISTNAME= pkg_filecheck-0.2 +DISTNAME= pkg_filecheck-0.3 CATEGORIES= pkgtools devel MASTER_SITES= # empty DISTFILES= # empty 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); |