summaryrefslogtreecommitdiff
path: root/source4/lib/policy/gp_ldap.c
diff options
context:
space:
mode:
authorWilco Baan Hofman <wilco@baanhofman.nl>2010-05-24 19:53:12 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-06-20 17:19:12 +0200
commitd61f0240eefc3c96a36c16a9bf83167eb01dfe94 (patch)
tree295e5632e7097724f5632b8aafe5cf4f5c90896e /source4/lib/policy/gp_ldap.c
parente86ef688ee4c65fc5dd06910fd61222c195c1dc9 (diff)
downloadsamba-d61f0240eefc3c96a36c16a9bf83167eb01dfe94.tar.gz
samba-d61f0240eefc3c96a36c16a9bf83167eb01dfe94.tar.bz2
samba-d61f0240eefc3c96a36c16a9bf83167eb01dfe94.zip
Fix 'magic' numbers to be strlen(something)
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Diffstat (limited to 'source4/lib/policy/gp_ldap.c')
-rw-r--r--source4/lib/policy/gp_ldap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source4/lib/policy/gp_ldap.c b/source4/lib/policy/gp_ldap.c
index 0c307085cb..d03ea0430b 100644
--- a/source4/lib/policy/gp_ldap.c
+++ b/source4/lib/policy/gp_ldap.c
@@ -302,12 +302,13 @@ static NTSTATUS parse_gplink (TALLOC_CTX *mem_ctx, const char *gplink_str, struc
int pos;
struct gp_link **gplinks;
char *buf, *end;
+ const char *gplink_start = "[LDAP://";
gplinks = talloc_array(mem_ctx, struct gp_link *, 1);
gplinks[0] = NULL;
/* Assuming every gPLink starts with "[LDAP://" */
- start = 8;
+ start = strlen(gplink_start);
for (pos = start; pos < strlen(gplink_str); pos++) {
if (gplink_str[pos] == ';') {
@@ -329,7 +330,7 @@ static NTSTATUS parse_gplink (TALLOC_CTX *mem_ctx, const char *gplink_str, struc
/* Increment the array index, the string position past
the next "[LDAP://", and set the start reference */
idx++;
- pos += 9;
+ pos += strlen(gplink_start)+1;
start = pos;
}
}