From 989d8803f28826e6541667127abad801c4fa4566 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Sat, 27 Nov 2010 20:19:34 +0100 Subject: tdb:common/open.c - use "discard_const_p" for certain "tdb->name" assignments In order to suppress compiler warnings. --- lib/tdb/common/open.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tdb/common/open.c b/lib/tdb/common/open.c index ce8e9f55ad..ec45689ffc 100644 --- a/lib/tdb/common/open.c +++ b/lib/tdb/common/open.c @@ -202,7 +202,7 @@ _PUBLIC_ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int td } if (name == NULL) { - tdb->name = "__NULL__"; + tdb->name = discard_const_p(char, "__NULL__"); TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_open_ex: called with name == NULL\n")); tdb->name = NULL; errno = EINVAL; @@ -215,7 +215,7 @@ _PUBLIC_ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int td * set the name as the given string, so that tdb_name() will * work in case of an error. */ - tdb->name = name; + tdb->name = discard_const_p(char, name); TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: can't strdup(%s)\n", name)); tdb->name = NULL; -- cgit