From 9411b8e49dc81856f6f34550b81045f83efbe548 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 26 Sep 2011 16:28:05 +0200 Subject: s3: Slightly simplify print_kdc_line() No code change except for an early "return talloc_asprintf(..)" making an else branch obsolete. --- source3/libads/kerberos.c | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'source3/libads') diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c index da86e25dfd..e729918b70 100644 --- a/source3/libads/kerberos.c +++ b/source3/libads/kerberos.c @@ -704,28 +704,27 @@ static char *print_kdc_line(char *mem_ctx, return NULL; } /* Success, use host:port */ - kdc_str = talloc_asprintf(mem_ctx, - "%s\tkdc = %s:%u\n", - prev_line, - hostname, - (unsigned int)port); - } else { + return talloc_asprintf(mem_ctx, + "%s\tkdc = %s:%u\n", + prev_line, + hostname, + (unsigned int)port); + } - /* no krb5 lib currently supports "kdc = ipv6 address" - * at all, so just fill in just the kdc_name if we have - * it and let the krb5 lib figure out the appropriate - * ipv6 address - gd */ + /* no krb5 lib currently supports "kdc = ipv6 address" + * at all, so just fill in just the kdc_name if we have + * it and let the krb5 lib figure out the appropriate + * ipv6 address - gd */ - if (kdc_name) { - kdc_str = talloc_asprintf(mem_ctx, "%s\tkdc = %s\n", - prev_line, kdc_name); - } else { - kdc_str = talloc_asprintf(mem_ctx, "%s\tkdc = %s\n", - prev_line, - print_sockaddr(addr, - sizeof(addr), - pss)); - } + if (kdc_name) { + kdc_str = talloc_asprintf(mem_ctx, "%s\tkdc = %s\n", + prev_line, kdc_name); + } else { + kdc_str = talloc_asprintf(mem_ctx, "%s\tkdc = %s\n", + prev_line, + print_sockaddr(addr, + sizeof(addr), + pss)); } return kdc_str; } -- cgit