From 71bf8326f53949821291771a8303e48245f5c6e7 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 1 Mar 2006 12:10:10 +0000 Subject: r13767: fix compiler warnings metze (This used to be commit 0ab3a42341bc1b44de4834adf010a0e511383bfa) --- source4/lib/samba3/idmap.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'source4/lib/samba3/idmap.c') diff --git a/source4/lib/samba3/idmap.c b/source4/lib/samba3/idmap.c index b1c7c0dcca..205089f1cc 100644 --- a/source4/lib/samba3/idmap.c +++ b/source4/lib/samba3/idmap.c @@ -58,17 +58,21 @@ NTSTATUS samba3_read_idmap(const char *fn, TALLOC_CTX *ctx, struct samba3_idmapd for (key = tdb_firstkey(tdb); key.dptr; key = tdb_nextkey(tdb, key)) { struct samba3_idmap_mapping map; - - if (strncmp(key.dptr, "GID ", 4) == 0) { + const char *k = (const char *)key.dptr; + const char *v; + + if (strncmp(k, "GID ", 4) == 0) { map.type = IDMAP_GROUP; - map.unix_id = atoi(key.dptr+4); + map.unix_id = atoi(k+4); val = tdb_fetch(tdb, key); - map.sid = dom_sid_parse_talloc(ctx, val.dptr); - } else if (strncmp(key.dptr, "UID ", 4) == 0) { + v = (const char *)val.dptr; + map.sid = dom_sid_parse_talloc(ctx, v); + } else if (strncmp(k, "UID ", 4) == 0) { map.type = IDMAP_USER; - map.unix_id = atoi(key.dptr+4); + map.unix_id = atoi(k+4); val = tdb_fetch(tdb, key); - map.sid = dom_sid_parse_talloc(ctx, val.dptr); + v = (const char *)val.dptr; + map.sid = dom_sid_parse_talloc(ctx, v); } else { continue; } -- cgit