Source-Changes-HG archive

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

[src/trunk]: src/tests/lib/libc/db don't pass NULL to printf(), but use "<mem...



details:   https://anonhg.NetBSD.org/src/rev/d50f7a9d473b
branches:  trunk
changeset: 943598:d50f7a9d473b
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Sep 07 00:28:44 2020 +0000

description:
don't pass NULL to printf(), but use "<memory>" to signify this
test is operating on an in-memory only database.

diffstat:

 tests/lib/libc/db/t_db_hash_seq.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 4d186092d34f -r d50f7a9d473b tests/lib/libc/db/t_db_hash_seq.c
--- a/tests/lib/libc/db/t_db_hash_seq.c Mon Sep 07 00:26:23 2020 +0000
+++ b/tests/lib/libc/db/t_db_hash_seq.c Mon Sep 07 00:28:44 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_db_hash_seq.c,v 1.3 2019/07/09 16:24:01 maya Exp $   */
+/*     $NetBSD: t_db_hash_seq.c,v 1.4 2020/09/07 00:28:44 mrg Exp $    */
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_db_hash_seq.c,v 1.3 2019/07/09 16:24:01 maya Exp $");
+__RCSID("$NetBSD: t_db_hash_seq.c,v 1.4 2020/09/07 00:28:44 mrg Exp $");
 
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -107,7 +107,8 @@
        if (db == NULL) {
                if (errno == ENOENT && (flags & O_CREAT) == 0)
                        return NULL;
-               DO_ERR("%s: can't open `%s'", __func__, dbname);
+               DO_ERR("%s: can't open `%s'", __func__,
+                   dbname ? dbname : "<memory>");
        }
        return db;
 }



Home | Main Index | Thread Index | Old Index