catch error from as.*printf

This commit is contained in:
Love Hornquist Astrand
2010-05-30 14:12:39 -07:00
parent 2b1645aa08
commit 0b2b9d9834
4 changed files with 13 additions and 13 deletions

View File

@@ -298,10 +298,10 @@ _expand_temp_folder(krb5_context context, PTYPE param, const char *postfix, char
}
static int
_expand_userid(krb5_context context, PTYPE param, const char *postfix, char **ret)
_expand_userid(krb5_context context, PTYPE param, const char *postfix, char **str)
{
asprintf(ret, "%ld", (unsigned long)getuid());
if (*ret == NULL)
int ret = asprintf(str, "%ld", (unsigned long)getuid());
if (ret < 0 || *str == NULL)
return ENOMEM;
return 0;
}