diff options
author | Volker Lendecke <vl@samba.org> | 2011-09-26 16:28:05 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2011-09-26 16:48:43 +0200 |
commit | 9411b8e49dc81856f6f34550b81045f83efbe548 (patch) | |
tree | c0b0b0c87e8f0031f688a6461892d86a5d2a826a /source3/libads | |
parent | 01eb3136b6e22adf1860deabba5232a82644388b (diff) | |
download | samba-9411b8e49dc81856f6f34550b81045f83efbe548.tar.gz samba-9411b8e49dc81856f6f34550b81045f83efbe548.tar.bz2 samba-9411b8e49dc81856f6f34550b81045f83efbe548.zip |
s3: Slightly simplify print_kdc_line()
No code change except for an early "return talloc_asprintf(..)" making an else
branch obsolete.
Diffstat (limited to 'source3/libads')
-rw-r--r-- | source3/libads/kerberos.c | 39 |
1 files changed, 19 insertions, 20 deletions
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; } |