diff options
Diffstat (limited to 'source3/intl/lang_tdb.c')
-rw-r--r-- | source3/intl/lang_tdb.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/source3/intl/lang_tdb.c b/source3/intl/lang_tdb.c index ddb3d4d65e..2ccd2073db 100644 --- a/source3/intl/lang_tdb.c +++ b/source3/intl/lang_tdb.c @@ -32,7 +32,7 @@ static BOOL load_msg(const char *msg_file) char **lines; int num_lines, i; char *msgid, *msgstr; - TDB_DATA key, data; + TDB_DATA data; lines = file_lines_load(msg_file, &num_lines,0); @@ -63,11 +63,8 @@ static BOOL load_msg(const char *msg_file) } all_string_sub(msgid, "\\n", "\n", 0); all_string_sub(msgstr, "\\n", "\n", 0); - key.dptr = msgid; - key.dsize = strlen(msgid)+1; - data.dptr = msgstr; - data.dsize = strlen(msgstr)+1; - tdb_store(tdb, key, data, 0); + data = string_term_tdb_data(msgstr); + tdb_store_bystring(tdb, msgid, data, 0); msgid = NULL; } } @@ -178,7 +175,7 @@ BOOL lang_tdb_init(const char *lang) */ const char *lang_msg(const char *msgid) { - TDB_DATA key, data; + TDB_DATA data; const char *p; char *q, *msgid_quoted; int count; @@ -214,10 +211,7 @@ const char *lang_msg(const char *msgid) *q = 0; - key.dptr = (char *)msgid_quoted; - key.dsize = strlen(msgid_quoted)+1; - - data = tdb_fetch(tdb, key); + data = tdb_fetch_bystring(tdb, msgid_quoted); free(msgid_quoted); |