diff options
author | Toomas Soome <tsoome@me.com> | 2019-01-26 19:15:15 +0200 |
---|---|---|
committer | Toomas Soome <tsoome@me.com> | 2019-07-31 09:31:00 +0300 |
commit | 1dfc79c00accaeca37225189e270abb0fab8619e (patch) | |
tree | 4f407ef45d508769de6f62d43d43067f11630f7b | |
parent | 61aaa916808c601f9ee36d96c05ee9dac211d09e (diff) | |
download | illumos-joyent-1dfc79c00accaeca37225189e270abb0fab8619e.tar.gz |
11447 xargs: NULL pointer errors
Reviewed by: Andy Fiddaman <andy@omniosce.org>
Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r-- | usr/src/cmd/xargs/xargs.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/usr/src/cmd/xargs/xargs.c b/usr/src/cmd/xargs/xargs.c index 26feb9bdf6..ba582df141 100644 --- a/usr/src/cmd/xargs/xargs.c +++ b/usr/src/cmd/xargs/xargs.c @@ -36,7 +36,7 @@ */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ #include <stdio.h> @@ -177,8 +177,8 @@ main(int argc, char **argv) n_inserts = 0; psave = saveargv; (void) setlocale(LC_ALL, ""); -#if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */ -#define TEXT_DOMAIN "SYS_TEST" /* Use this only if it weren't */ +#if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */ +#define TEXT_DOMAIN "SYS_TEST" /* Use this only if it weren't */ #endif (void) textdomain(TEXT_DOMAIN); if (init_yes() < 0) { @@ -376,7 +376,7 @@ main(int argc, char **argv) */ - mac -= optind; /* dec arg count by what we've processed */ + mac -= optind; /* dec arg count by what we've processed */ mav += optind; /* inc to current mav */ procs = calloc(MAXPROCS, sizeof (pid_t)); @@ -1100,7 +1100,7 @@ parseargs(int ac, char **av) /* * if we're doing special processing, and we've got a flag */ - else if ((av[i][0] == '-') && (av[i][1] != NULL)) { + else if ((av[i][0] == '-') && (av[i][1] != '\0')) { char *def; switch (av[i][1]) { @@ -1119,11 +1119,11 @@ process_special: * be able to distinguish between a valid * suboption, and a command name. */ - if (av[i][2] == NULL) { + if (av[i][2] == '\0') { mav[++mac] = strdup(def); } else { /* clear out our version: */ - mav[mac][2] = NULL; + mav[mac][2] = '\0'; mav[++mac] = strdup(&av[i][2]); } if (mav[mac] == NULL) { @@ -1157,9 +1157,9 @@ process_special: * we move the subargument into our * mod'd argument list. */ - if (av[i][2] != NULL) { + if (av[i][2] != '\0') { /* first clean things up: */ - mav[mac][2] = NULL; + mav[mac][2] = '\0'; /* now add the separation: */ ++mac; /* inc to next mod'd arg */ |