* 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
#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);