diff options
author | Jim Meyering <meyering@fb.com> | 2019-03-09 21:38:03 -0800 |
---|---|---|
committer | Jim Meyering <meyering@fb.com> | 2019-03-09 21:38:03 -0800 |
commit | 81d0d262d83345d3f50b21b0926b740027a1020a (patch) | |
tree | 7e56ab1517a067caa6efafd9dc651cb72470a513 /tests | |
parent | 2ba60a9f14486037d73d97408843d11297726a7e (diff) | |
download | gnulib-81d0d262d83345d3f50b21b0926b740027a1020a.tar.gz |
test-userspec.c: don't print NULL
* tests/test-userspec.c (main): A test release of gcc,
9.0.1 20190310, warned that this test would attempt to
print a NULL pointer via a %s printf format. Fix that
and remove the unnecessary preceding "!diag" conjunct.
Also add a comment.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-userspec.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test-userspec.c b/tests/test-userspec.c index 8211aa2349..800169bb29 100644 --- a/tests/test-userspec.c +++ b/tests/test-userspec.c @@ -170,10 +170,12 @@ main (void) fail = 1; } - if (!diag && !T[i].result) + if (!T[i].result) continue; - printf ("%s diagnostic mismatch (-: expected uid,gid; +:actual)\n" + /* Expected a non-NULL result diagnostic, yet got NULL. */ + diag = "NULL"; + printf ("%s diagnostic mismatch (-: expected diagnostic; +:actual)\n" "-%s\n+%s\n", T[i].in, T[i].result, diag); fail = 1; } |