From a6c7211a0899755d42622692efadd8ab49170c7e Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Wed, 12 Jan 2011 23:31:58 +0000 Subject: [PATCH] In krb5_set_realm(): * Return EINVAL and ENOMEM correctly. * Accept an empty realm instead of returning EINVAL. * Wrap a long line. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24595 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/set_realm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/krb5/krb/set_realm.c b/src/lib/krb5/krb/set_realm.c index 0128f6cb1..94a476338 100644 --- a/src/lib/krb5/krb/set_realm.c +++ b/src/lib/krb5/krb/set_realm.c @@ -28,18 +28,19 @@ #include "k5-int.h" krb5_error_code KRB5_CALLCONV -krb5_set_principal_realm(krb5_context context, krb5_principal principal, const char *realm) +krb5_set_principal_realm(krb5_context context, krb5_principal principal, + const char *realm) { size_t length; char *newrealm; - if (!realm || !*realm) - return -EINVAL; + if (!realm) + return EINVAL; length = strlen(realm); newrealm = strdup(realm); if (!newrealm) - return -ENOMEM; + return ENOMEM; (void) free(krb5_princ_realm(context,principal)->data); -- 2.26.2