From a6959a060879676e965529db823ea71db60ac49b Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Sat, 26 Jan 2019 19:16:41 +0200 Subject: 11448 xstr: NULL pointer errors Reviewed by: Andy Fiddaman Approved by: Dan McDonald --- usr/src/cmd/xstr/xstr.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/usr/src/cmd/xstr/xstr.c b/usr/src/cmd/xstr/xstr.c index 7378337aa2..d2f7c659b0 100644 --- a/usr/src/cmd/xstr/xstr.c +++ b/usr/src/cmd/xstr/xstr.c @@ -4,7 +4,7 @@ */ /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ /* * Copyright (c) 1980 Regents of the University of California. @@ -12,8 +12,6 @@ * specifies the terms and conditions for redistribution. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -272,7 +270,7 @@ inithash(void) return; for (;;) { mesgpt = tellpt; - if (fgetNUL(buf, sizeof (buf), mesgread) == NULL) + if (fgetNUL(buf, sizeof (buf), mesgread) == 0) break; (void) hashit(buf, 0); } @@ -288,7 +286,7 @@ fgetNUL(char *obuf, int rmdr, FILE *file) while (--rmdr > 0 && (c = xgetc(file)) != 0 && c != EOF) *buf++ = c; *buf++ = 0; - return ((feof(file) || ferror(file)) ? NULL : 1); + return ((feof(file) || ferror(file)) ? 0 : 1); } int -- cgit v1.2.3