From 78a328bef894a78881dfae9f278dd839b86fc82f Mon Sep 17 00:00:00 2001 From: Rafal Szczesniak Date: Sun, 20 Nov 2005 21:33:30 +0000 Subject: r11813: Const-ify name resolution method list and use string list utilities to set the context field. rafal (This used to be commit 5da8b457c34236b21f6e88e3a7a12338d0390a4f) --- source4/libnet/libnet.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'source4/libnet/libnet.c') diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c index b7b18b7417..ba995854b2 100644 --- a/source4/libnet/libnet.c +++ b/source4/libnet/libnet.c @@ -26,7 +26,6 @@ struct libnet_context *libnet_context_init(struct event_context *ev) { /* default name resolution methods */ const char *nr_methods[] = { "lmhosts", "wins", "host", "bcast", NULL }; - int nr_count = 0, nr_i; struct libnet_context *ctx; @@ -46,15 +45,7 @@ struct libnet_context *libnet_context_init(struct event_context *ev) } ctx->event_ctx = ev; - /* count name resolution methods */ - while (nr_methods[nr_count]) nr_count++; - - /* assign name resolution methods */ - ctx->name_res_methods = talloc_array(ctx, char*, nr_count+1); - for (nr_i = 0; nr_i < nr_count; nr_i++) { - ctx->name_res_methods[nr_i] = talloc_strdup(ctx, nr_methods[nr_i]); - } - ctx->name_res_methods[nr_i] = NULL; + ctx->name_res_methods = str_list_copy(ctx, nr_methods); return ctx; } -- cgit