commit 668fbd286f754e5bd561672d12c20ed80bbb5fc5 parent d15de502ef961f2c0d267f672ef339d5a4280a37 Author: Evgeny Grin (Karlson2k) <k2k@narod.ru> Date: Sat, 15 Jun 2024 13:00:41 +0200 test_str_bin_hex: fixed reporting Diffstat:
| M | src/microhttpd/test_str_bin_hex.c | | | 5 | +++-- |
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/microhttpd/test_str_bin_hex.c b/src/microhttpd/test_str_bin_hex.c @@ -137,11 +137,12 @@ expect_decoded_n (const char *const hex, const size_t hex_len, "Wrong output data:\n"); } } - if (fill_chr != buf[res_size]) + if (((0 == res_size) && (fill_chr != buf[bin_size])) + || ((0 != res_size) && (fill_chr != buf[res_size]))) { check_res = 1; fprintf (stderr, - "'MHD_str_pct_decode_strict_n_ ()' FAILED: " + "'MHD_hex_to_bin ()' FAILED: " "A char written outside the buffer:\n"); } if (0 != check_res)