From: Ken Raeburn Date: Fri, 30 Jun 2006 00:17:43 +0000 (+0000) Subject: (add_db_arg): Fix silly bug. X-Git-Tag: krb5-1.6-alpha1~236 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2996a60ffcf03a1855ab44496d137c065b765544;p=krb5.git (add_db_arg): Fix silly bug. (extended_com_err_fn): Don't look up or print error message if the error code is 0. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18277 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kadmin/dbutil/kdb5_util.c b/src/kadmin/dbutil/kdb5_util.c index 5abe708ad..00c87a225 100644 --- a/src/kadmin/dbutil/kdb5_util.c +++ b/src/kadmin/dbutil/kdb5_util.c @@ -149,9 +149,13 @@ static void extended_com_err_fn (const char *myprog, errcode_t code, const char *fmt, va_list args) { const char *emsg; - emsg = krb5_get_error_message (util_context, code); - fprintf (stderr, "%s: %s ", myprog, emsg); - krb5_free_error_message (util_context, emsg); + if (code) { + emsg = krb5_get_error_message (util_context, code); + fprintf (stderr, "%s: %s ", myprog, emsg); + krb5_free_error_message (util_context, emsg); + } else { + fprintf (stderr, "%s: ", myprog); + } vfprintf (stderr, fmt, args); fprintf (stderr, "\n"); } @@ -164,6 +168,7 @@ int add_db_arg(char *arg) sizeof(char *) * (db5util_db_args_size + 1)); if (temp == NULL) return 0; + db5util_db_args = temp; db5util_db_args[db5util_db_args_size-1] = arg; db5util_db_args[db5util_db_args_size] = NULL; return 1;