From 6730ad84968681d86ff7d82751fe886a2f138673 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Wed, 9 Dec 2009 04:00:09 +0100 Subject: Consolidate code for splitting strings by separator There were two functions for parsing strings by a separator. This patch consolidates on the one previously used in confdb. This also allows stripping the tokens of whitespace. Fixes: #319 --- server/providers/ipa/ipa_common.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'server/providers/ipa/ipa_common.c') diff --git a/server/providers/ipa/ipa_common.c b/server/providers/ipa/ipa_common.c index 0b0eb4897..5ef19da76 100644 --- a/server/providers/ipa/ipa_common.c +++ b/server/providers/ipa/ipa_common.c @@ -508,7 +508,6 @@ int ipa_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx, struct ipa_service *service; char **list = NULL; char *realm; - int count = 0; int ret; int i; @@ -562,14 +561,14 @@ int ipa_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx, service->krb5_service->realm = realm; /* split server parm into a list */ - ret = sss_split_list(tmp_ctx, servers, ", ", &list, &count); + ret = split_on_separator(tmp_ctx, servers, ',', true, &list, NULL); if (ret != EOK) { DEBUG(1, ("Failed to parse server list!\n")); goto done; } /* now for each one add a new server to the failover service */ - for (i = 0; i < count; i++) { + for (i = 0; list[i]; i++) { talloc_steal(service, list[i]); -- cgit