Subject: bin/3745: NULL is used in integer context in pkg_delete
To: None <gnats-bugs@gnats.netbsd.org>
From: None <arnej@math.ntnu.no>
List: netbsd-bugs
Date: 06/13/1997 17:13:49
>Number: 3745
>Category: bin
>Synopsis: NULL is used in integer context in pkg_delete
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people (Utility Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Jun 13 08:20:02 1997
>Last-Modified:
>Originator: Arne H. Juul
>Organization:
Norwegian University of Technology and Science
>Release: NetBSD-current as of Jun 13, 1997
>Environment:
System: NetBSD leon.math.ntnu.no 1.2E NetBSD 1.2E (NIKITA) #15: Fri Jun 6 10:21:20 CEST 1997 arnej@leon.math.ntnu.no:/usr/src/sys/arch/i386/compile/NIKITA i386
>Description:
NULL is used in integer context in pkg_delete's main.c.
>How-To-Repeat:
compile with NULL #define'd as (void *)0 and get:
cc1: warnings being treated as errors
/usr/src/usr.sbin/pkg_install/delete/main.c: In function `main':
/usr/src/usr.sbin/pkg_install/delete/main.c:98: warning: comparison between pointer and integer
>Fix:
Apply this patch:
--- src/usr.sbin/pkg_install/delete/main.c.orig Fri Jun 6 13:41:57 1997
+++ src/usr.sbin/pkg_install/delete/main.c Fri Jun 13 07:42:57 1997
@@ -95,7 +95,7 @@
*pkgs = NULL;
if (!Fake && getuid() != 0)
errx(1, "You must be root to delete packages.");
- if ((error = pkg_perform(start)) != NULL) {
+ if ((error = pkg_perform(start)) != 0) {
if (Verbose)
fprintf(stderr, "%d package deletion(s) failed.\n", error);
return error;
>Audit-Trail:
>Unformatted: