Files
json-c/tests
Sangamesh Mallayya 52f57ec18a AIX: Fix test_json_patch NULL pointer passed to printf
Some test_json_patch test cases have neither a comment field and
nor a error field, so the expression
"comment ? comment : error_s"  evaluates to NULL.

The printf statement

printf("Testing '%s', ...", comment ? comment : error_s, ...);

passes NULL as a %s argument. GNU libc handles this gracefully and prints (null).
On AIX, passing NULL for %s prints an empty string, causing the test output
to differ from the expected file.

The fix adds a simple macro:

define STR_OR_NULL(s) ((s) ? (s) : "(null)")

that retruns "(null)" when s is NULL.
2026-09-21 01:03:16 -05:00
..
2022-08-13 20:47:20 -07:00
2022-08-13 20:47:20 -07:00
2020-03-31 19:12:45 +08:00
2022-08-13 15:47:40 +03:00
2020-03-31 19:12:45 +08:00
2026-09-07 09:58:09 +08:00