From fc0d37a6e621466bf706092bd4899ceb5be6e74e Mon Sep 17 00:00:00 2001 From: Lucas Caudill Date: Thu, 31 Aug 2023 19:02:02 +0000 Subject: [PATCH] think I figured it out... --- bin/ch-run.c | 3 +-- bin/ch_misc.c | 6 ------ test/run/ch-run_misc.bats | 3 +-- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/bin/ch-run.c b/bin/ch-run.c index e78ccfe19..cb861df81 100644 --- a/bin/ch-run.c +++ b/bin/ch-run.c @@ -132,8 +132,7 @@ int main(int argc, char *argv[]) privs_verify_invoking(); - //Z_ (atexit(warnings_reprint)); - Z_ (atexit(test_exit)); + Z_ (atexit(warnings_reprint)); #ifdef ENABLE_SYSLOG diff --git a/bin/ch_misc.c b/bin/ch_misc.c index bff59fbd3..42d68d130 100644 --- a/bin/ch_misc.c +++ b/bin/ch_misc.c @@ -702,14 +702,9 @@ void version(void) size_t string_append(char *addr, char *str, size_t size, size_t offset) { size_t written = strlen(str) + 1; - size_t foo = offset + written - 1; - printf("test num: %ld\n", foo); if (size > (offset + written - 1)) // there is space - { - printf("got past if\n"); memcpy(addr + offset, str, written); - } return written; } @@ -717,7 +712,6 @@ size_t string_append(char *addr, char *str, size_t size, size_t offset) /* Reprint messages stored in “warnings” memory buffer. */ void warnings_reprint(void) { - printf("calling warings_reprint\n"); size_t offset = 0; int warn_ct = buf_strings_count(warnings, warnings_size); diff --git a/test/run/ch-run_misc.bats b/test/run/ch-run_misc.bats index ab9e5d51b..ad3637761 100644 --- a/test/run/ch-run_misc.bats +++ b/test/run/ch-run_misc.bats @@ -1063,8 +1063,7 @@ EOF run ch-run --warnings=1 echo "$output" [[ $status -eq 0 ]] - #[[ $(echo "$output" | grep -Fc 'this is warning 0!') -eq 2 ]] - [[ $(echo "$output" | grep -Ec 'this is warning [0-9]*!') -eq 2 ]] + [[ $(echo "$output" | grep -Fc 'this is warning 0!') -eq 2 ]] # Warnings list is a statically sized memory buffer. Ensure it works as # intended by printing more warnings than can be saved to this buffer and