summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2019-01-26 19:16:41 +0200
committerToomas Soome <tsoome@me.com>2019-07-31 09:33:36 +0300
commita6959a060879676e965529db823ea71db60ac49b (patch)
treef76bd49c97e42693a7f6c84f7b8799c07baf9fea
parent1dfc79c00accaeca37225189e270abb0fab8619e (diff)
downloadillumos-joyent-a6959a060879676e965529db823ea71db60ac49b.tar.gz
11448 xstr: NULL pointer errors
Reviewed by: Andy Fiddaman <andy@omniosce.org> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/cmd/xstr/xstr.c8
1 files 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 <stdio.h>
#include <ctype.h>
#include <sys/types.h>
@@ -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