/*-
- * Copyright (c) 2004 Nik Clayton
+ * Copyright (C) 2004 Nik Clayton
* All rights reserved.
*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* SUCH DAMAGE.
*/
-#define _GNU_SOURCE
#include <ctype.h>
#include <stdarg.h>
#include <stdio.h>
expansions on it */
if(test_name != NULL) {
va_start(ap, test_name);
- vasprintf(&local_test_name, test_name, ap);
+ if (vasprintf(&local_test_name, test_name, ap) == -1) {
+ local_test_name = NULL;
+ }
va_end(ap);
/* Make sure the test name contains more than digits
skip(unsigned int n, char *fmt, ...)
{
va_list ap;
- char *skip_msg;
+ char *skip_msg = NULL;
LOCK;
va_start(ap, fmt);
- asprintf(&skip_msg, fmt, ap);
+ if (asprintf(&skip_msg, fmt, ap) == -1) {
+ skip_msg = NULL;
+ }
va_end(ap);
while(n-- > 0) {
LOCK;
va_start(ap, fmt);
- vasprintf(&todo_msg, fmt, ap);
+ if (vasprintf(&todo_msg, fmt, ap) == -1) {
+ todo_msg = NULL;
+ }
va_end(ap);
todo = 1;