Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libc/regex Add more information for the malloc fai...



details:   https://anonhg.NetBSD.org/src/rev/51984add0e36
branches:  trunk
changeset: 379564:51984add0e36
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jun 07 11:45:35 2021 +0000

description:
Add more information for the malloc failure.

diffstat:

 tests/lib/libc/regex/t_exhaust.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 5406ec37900a -r 51984add0e36 tests/lib/libc/regex/t_exhaust.c
--- a/tests/lib/libc/regex/t_exhaust.c  Mon Jun 07 05:29:22 2021 +0000
+++ b/tests/lib/libc/regex/t_exhaust.c  Mon Jun 07 11:45:35 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_exhaust.c,v 1.10 2019/07/09 13:59:25 gson Exp $      */
+/*     $NetBSD: t_exhaust.c,v 1.11 2021/06/07 11:45:35 christos Exp $  */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_exhaust.c,v 1.10 2019/07/09 13:59:25 gson Exp $");
+__RCSID("$NetBSD: t_exhaust.c,v 1.11 2021/06/07 11:45:35 christos Exp $");
 
 #include <sys/resource.h>
 #include <atf-c.h>
@@ -69,7 +69,7 @@ concat(const char *d, const char *s)
        size_t slen = strlen(s);
        char *p = malloc(dlen + slen + 1);
 
-       ATF_REQUIRE(p != NULL);
+       ATF_REQUIRE_MSG(p != NULL, "slen=%zu, dlen=%zu", slen, dlen);
        strcpy(p, d);
        strcpy(p + dlen, s);
        return p;



Home | Main Index | Thread Index | Old Index