blob: 86e5056c5b6cf6c12d76491ce85045511d984f45 [file] [log] [blame]
Jakub Czapiga6f3fd632021-07-22 08:52:46 +02001/* SPDX-License-Identifier: GPL-2.0-only */
2
3#include <stdarg.h>
Jakub Czapiga6f3fd632021-07-22 08:52:46 +02004#include <tests/test.h>
5
6void die(const char *msg, ...)
7{
8 /* die() can be called in middle a function, so we should not allow for it to return */
9 static char msg_buf[256];
10 va_list v;
11 va_start(v, msg);
12 vsnprintf(msg_buf, ARRAY_SIZE(msg_buf), msg, v);
13 va_end(v);
14 fail_msg("%s", msg_buf);
15}