summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/tools/protocmp/exception_list.c8
-rw-r--r--usr/src/tools/protocmp/protocmp.c8
-rw-r--r--usr/src/tools/protocmp/protodir.c5
3 files changed, 11 insertions, 10 deletions
diff --git a/usr/src/tools/protocmp/exception_list.c b/usr/src/tools/protocmp/exception_list.c
index 5dd98fb6fe..f44f5296e9 100644
--- a/usr/src/tools/protocmp/exception_list.c
+++ b/usr/src/tools/protocmp/exception_list.c
@@ -22,6 +22,8 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright 2015 PALO, Richard
*/
#include <stdio.h>
@@ -56,6 +58,10 @@ parse_exception_line(char *line, elem_list *list)
}
e = (elem *) malloc(sizeof (elem));
+ if (e == NULL) {
+ perror("malloc");
+ exit(1);
+ }
e->inode = 0;
e->perm = 0;
@@ -68,7 +74,7 @@ parse_exception_line(char *line, elem_list *list)
e->symsrc = NULL;
e->file_type = DIR_T;
- while ((e->arch = assign_arch(arch)) == NULL) {
+ while ((e->arch = assign_arch(arch)) == 0) {
if ((arch = strtok(NULL, FS)) == NULL) {
return (0);
}
diff --git a/usr/src/tools/protocmp/protocmp.c b/usr/src/tools/protocmp/protocmp.c
index a2897477cb..4cd1b56eb2 100644
--- a/usr/src/tools/protocmp/protocmp.c
+++ b/usr/src/tools/protocmp/protocmp.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
@@ -685,7 +683,7 @@ main(int argc, char **argv)
{
int errflg = 0;
int i, c;
- int list_filtered_exceptions = NULL;
+ int list_filtered_exceptions = 0;
int n_proto_refs = 0;
int n_exception_files = 0;
char *proto_refs[MAX_PROTO_REFS];
@@ -729,7 +727,7 @@ main(int argc, char **argv)
errflg++;
(void) fprintf(stderr,
"Only %d exception files supported\n",
- MAX_EXCEPTION_FILES);
+ MAX_EXCEPTION_FILES);
} else {
exception_files[n_exception_files++] = optarg;
}
@@ -745,7 +743,7 @@ main(int argc, char **argv)
errflg++;
(void) fprintf(stderr,
"Only %d proto references supported\n",
- MAX_PROTO_REFS);
+ MAX_PROTO_REFS);
} else {
proto_refs[n_proto_refs++] = optarg;
}
diff --git a/usr/src/tools/protocmp/protodir.c b/usr/src/tools/protocmp/protodir.c
index 352c36a8b2..520f5359f3 100644
--- a/usr/src/tools/protocmp/protodir.c
+++ b/usr/src/tools/protocmp/protodir.c
@@ -24,9 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-
#include <stdio.h>
#include <sys/param.h>
#include <fcntl.h>
@@ -424,7 +421,7 @@ read_pkginfo(const char *protodir, short *arch, char *basedir)
(void) fclose(pkginfo_fp);
if (architecture[0])
- if ((*arch = assign_arch(architecture)) == NULL) {
+ if ((*arch = assign_arch(architecture)) == 0) {
(void) fprintf(stderr,
"warning: Unknown architecture %s found in %s\n",
architecture, pkginfofile);