summaryrefslogtreecommitdiff
path: root/source3/intl
diff options
context:
space:
mode:
Diffstat (limited to 'source3/intl')
-rw-r--r--source3/intl/lang_tdb.c5
-rw-r--r--source3/intl/lang_tdb.h23
2 files changed, 26 insertions, 2 deletions
diff --git a/source3/intl/lang_tdb.c b/source3/intl/lang_tdb.c
index 8fcb9f2bfc..6070e29e5a 100644
--- a/source3/intl/lang_tdb.c
+++ b/source3/intl/lang_tdb.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "system/filesys.h"
#include "intl/lang_tdb.h"
+#include "util_tdb.h"
static TDB_CONTEXT *tdb;
@@ -130,7 +131,7 @@ bool lang_tdb_init(const char *lang)
return True;
if (asprintf(&msg_path, "%s.msg",
- data_path((const char *)lang)) == -1) {
+ data_path(talloc_tos(), (const char *)lang)) == -1) {
DEBUG(0, ("asprintf failed\n"));
goto done;
}
@@ -236,7 +237,7 @@ const char *lang_msg(const char *msgid)
void lang_msg_free(const char *msgstr)
{
if (!tdb) return;
- free((void *)msgstr);
+ free(discard_const_p(void, msgstr));
}
/*
diff --git a/source3/intl/lang_tdb.h b/source3/intl/lang_tdb.h
index da246846d0..2f9c3f19e5 100644
--- a/source3/intl/lang_tdb.h
+++ b/source3/intl/lang_tdb.h
@@ -1,3 +1,24 @@
+/*
+ Unix SMB/CIFS implementation.
+ tdb based replacement for gettext
+ Copyright (C) Andrew Tridgell 2001
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef _INTL_LANG_TDB_H_
+#define _INTL_LANG_TDB_H_
/* The following definitions come from intl/lang_tdb.c */
@@ -5,3 +26,5 @@ bool lang_tdb_init(const char *lang);
const char *lang_msg(const char *msgid);
void lang_msg_free(const char *msgstr);
char *lang_tdb_current(void);
+
+#endif /* _INTL_LANG_TDB_H_ */