blob: 3dd248b7cba59c1f3b2d87994500530d6b460ad5 [file]
/* SPDX-License-Identifier: 0BSD */
/* SPDX-FileCopyrightText: 2025 Uwe Kleine-König <u.kleine-koenig@baylibre.com> */
#include "config.h"
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include "pwm-internal.h"
void perrorf(const char *restrict format, ...)
{
va_list args;
char *buf;
int ret;
va_start(args, format);
ret = vasprintf(&buf, format, args);
va_end(args);
if (ret < 0) {
errno = ENOMEM;
perror("Out of memory");
return;
}
perror(buf);
free(buf);
}