From 9dd00020ae8a1542eb9f094a277e30f5f2234146 Mon Sep 17 00:00:00 2001 From: "Pavel I. Kryukov" Date: Sun, 15 Dec 2019 23:10:15 +0300 Subject: [PATCH] Update out_of_memory stub function for utils.c test (cherry picked from commit 056288677bd77b62435956975a937f47ce0f4dc8) --- utils.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/utils.c b/utils.c index 6cd1cf4c..3b0f75c5 100644 --- a/utils.c +++ b/utils.c @@ -182,10 +182,21 @@ int main(void) printf("passed %d failed %d total %d\n", passes, fails, passes+fails); return fails != 0 ? 1 : 0; } + /* Stubs to stop the rest of this module causing compile failures. */ -void modalfatalbox(const char *fmt, ...) {} -int conf_get_int(Conf *conf, int primary) { return 0; } -char *conf_get_str(Conf *conf, int primary) { return NULL; } +static NORETURN void fatal_error(const char *p, ...) +{ + va_list ap; + fprintf(stderr, "host_string_test: "); + va_start(ap, p); + vfprintf(stderr, p, ap); + va_end(ap); + fputc('\n', stderr); + exit(1); +} + +void out_of_memory(void) { fatal_error("out of memory"); } + #endif /* TEST_HOST_STRFOO */ /*