summaryrefslogtreecommitdiff
path: root/source3/registry/reg_perfcount.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-03-27 10:15:45 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:18:55 -0500
commitc2f09ee288b71a47f2bb3fcc0b6ad98ae426a3e8 (patch)
tree05fae37805751781ac859426cf2bf5e11ef5e4da /source3/registry/reg_perfcount.c
parent4d7c7bb68923aca232c3a6f59367af946e58d792 (diff)
downloadsamba-c2f09ee288b71a47f2bb3fcc0b6ad98ae426a3e8.tar.gz
samba-c2f09ee288b71a47f2bb3fcc0b6ad98ae426a3e8.tar.bz2
samba-c2f09ee288b71a47f2bb3fcc0b6ad98ae426a3e8.zip
r21979: make use of string_tdb_data()
to avoid creating the TDB_DATA struct from strings "by hand" note: we can't use the tdb_*_bystring functions here, as the key isn't null-terminated here... metze (This used to be commit 29b42ea89cbdd9f2c12fa448b116c49669467faf)
Diffstat (limited to 'source3/registry/reg_perfcount.c')
-rw-r--r--source3/registry/reg_perfcount.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/source3/registry/reg_perfcount.c b/source3/registry/reg_perfcount.c
index 4cde733044..c90f989515 100644
--- a/source3/registry/reg_perfcount.c
+++ b/source3/registry/reg_perfcount.c
@@ -98,8 +98,7 @@ uint32 reg_perfcount_get_base_index(void)
even_num+1 perf_counter<even_num>_help
and so on.
So last_counter becomes num_counters*2, and last_help will be last_counter+1 */
- kbuf.dptr = key;
- kbuf.dsize = strlen(key);
+ kbuf = string_tdb_data(key);
dbuf = tdb_fetch(names, kbuf);
if(dbuf.dptr == NULL)
{
@@ -166,8 +165,7 @@ static uint32 _reg_perfcount_multi_sz_from_tdb(TDB_CONTEXT *tdb,
memset(temp, 0, sizeof(temp));
snprintf(temp, sizeof(temp), "%d", keyval);
- kbuf.dptr = temp;
- kbuf.dsize = strlen(temp);
+ kbuf = string_tdb_data(temp);
dbuf = tdb_fetch(tdb, kbuf);
if(dbuf.dptr == NULL)
{
@@ -309,8 +307,7 @@ static void _reg_perfcount_make_key(TDB_DATA *key,
else
snprintf(buf, buflen, "%d", key_part1);
- key->dptr = buf;
- key->dsize = strlen(buf);
+ *key = string_tdb_data(buf);
return;
}