Add some sanity checks on what pkgdb_retrieve() returns.

Noted by D'Arcy J.M. Cain <darcy@druid.druid.net> on current-users.
This commit is contained in:
hubertf 1999-09-24 14:39:44 +00:00
parent a222db7c70
commit 1f6247c83d
1 changed files with 4 additions and 2 deletions

View File

@ -1,11 +1,11 @@
/* $NetBSD: main.c,v 1.13 1999/08/24 00:48:39 hubertf Exp $ */
/* $NetBSD: main.c,v 1.14 1999/09/24 14:39:44 hubertf Exp $ */
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char *rcsid = "from FreeBSD Id: main.c,v 1.11 1997/10/08 07:46:48 charnier Exp";
#else
__RCSID("$NetBSD: main.c,v 1.13 1999/08/24 00:48:39 hubertf Exp $");
__RCSID("$NetBSD: main.c,v 1.14 1999/09/24 14:39:44 hubertf Exp $");
#endif
#endif
@ -181,6 +181,8 @@ main(int argc, char **argv)
error = 0;
while ((key = pkgdb_iter())) {
val = pkgdb_retrieve(key);
if (val == NULL || *val == '\0')
continue;
lpp = TAILQ_FIRST(&pkgs);
if (lpp != NULL) {