From 572f35dd8be5b8f430c6b0256ae13138fca81687 Mon Sep 17 00:00:00 2001 From: jmallett Date: Sat, 4 May 2002 05:53:02 +0000 Subject: Don't use pointers as booleans. --- usr.bin/xargs/xargs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.bin/xargs') diff --git a/usr.bin/xargs/xargs.c b/usr.bin/xargs/xargs.c index b14315a..4b114ad 100644 --- a/usr.bin/xargs/xargs.c +++ b/usr.bin/xargs/xargs.c @@ -183,7 +183,7 @@ main(int argc, char **argv) * shell. Echo is the default. Set up pointers for the user's * arguments. */ - if (!*argv) + if (*argv == NULL) cnt = strlen((*bxp++ = echo)); else { do { @@ -195,7 +195,7 @@ main(int argc, char **argv) break; } cnt += strlen(*bxp++ = *argv) + 1; - } while (*++argv); + } while (*++argv != NULL); } /* @@ -446,7 +446,7 @@ run(char **argv) if (tflag || pflag) { (void)fprintf(stderr, "%s", *argv); - for (p = argv + 1; *p; ++p) + for (p = argv + 1; *p != NULL; ++p) (void)fprintf(stderr, " %s", *p); if (pflag && (ttyfp = fopen("/dev/tty", "r")) != NULL) { (void)fprintf(stderr, "?"); -- cgit v1.1