aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-04-05 20:02:26 -0700
committerMichael Forney <mforney@mforney.org>2019-04-06 12:01:51 -0700
commit4c697d5087e5f5aaa01bada73396058eed88525d (patch)
treef6ab372f390bcc83684282cdea1743daebeb6fd5
parent2b95bd2fe11ac8e982fc88d42661bd5cf3f6e475 (diff)
downloadcproc-4c697d5087e5f5aaa01bada73396058eed88525d.tar.xz
arg: Use (void *)0 instead of NULL in error case of conditional expression
Even though NULL is a null pointer constant, the comma expression with NULL at the end is not. So, we must ensure that either the type of the comma expression is `char *` or `void *`, and we don't know this for NULL.
-rw-r--r--arg.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arg.h b/arg.h
index 8f93ee1..d428660 100644
--- a/arg.h
+++ b/arg.h
@@ -15,4 +15,4 @@
}
#define EARGF(x) \
- (done_ = 1, *++opt_ ? opt_ : argv[1] ? --argc, *++argv : ((x), abort(), NULL))
+ (done_ = 1, *++opt_ ? opt_ : argv[1] ? --argc, *++argv : ((x), abort(), (void *)0))