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