summaryrefslogtreecommitdiff
path: root/source4/heimdal/lib/hx509/error.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-06-13 05:44:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:53:18 -0500
commit91adebe749beb0dc23cacaea316cb2b724776aad (patch)
tree133d480f5b23b99fcf1149861136103dc4525cb1 /source4/heimdal/lib/hx509/error.c
parentf7110d928afd61cee203d07fd85968af993a327f (diff)
downloadsamba-91adebe749beb0dc23cacaea316cb2b724776aad.tar.gz
samba-91adebe749beb0dc23cacaea316cb2b724776aad.tar.bz2
samba-91adebe749beb0dc23cacaea316cb2b724776aad.zip
r23456: Update Samba4 to current lorikeet-heimdal.
Andrew Bartlett (This used to be commit ae0f81ab235c72cceb120bcdeb051a483cf3cc4f)
Diffstat (limited to 'source4/heimdal/lib/hx509/error.c')
-rw-r--r--source4/heimdal/lib/hx509/error.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/source4/heimdal/lib/hx509/error.c b/source4/heimdal/lib/hx509/error.c
index 770b71981a..9f3a014873 100644
--- a/source4/heimdal/lib/hx509/error.c
+++ b/source4/heimdal/lib/hx509/error.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006 Kungliga Tekniska Högskolan
+ * Copyright (c) 2006 - 2007 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -32,7 +32,7 @@
*/
#include "hx_locl.h"
-RCSID("$Id: error.c,v 1.4 2006/11/16 15:08:09 lha Exp $");
+RCSID("$Id: error.c 20912 2007-06-05 03:53:52Z lha $");
struct hx509_error_data {
hx509_error next;
@@ -87,7 +87,8 @@ hx509_set_error_stringv(hx509_context context, int flags, int code,
}
void
-hx509_set_error_string(hx509_context context, int flags, int code, const char *fmt, ...)
+hx509_set_error_string(hx509_context context, int flags, int code,
+ const char *fmt, ...)
{
va_list ap;
@@ -100,9 +101,9 @@ char *
hx509_get_error_string(hx509_context context, int error_code)
{
struct rk_strpool *p = NULL;
- hx509_error msg;
+ hx509_error msg = context->error;
- if (context->error == NULL) {
+ if (msg == NULL || msg->code != error_code) {
const char *cstr;
char *str;
@@ -125,10 +126,12 @@ hx509_get_error_string(hx509_context context, int error_code)
}
void
-hx509_err(hx509_context context, int exit_code, int error_code, char *fmt, ...)
+hx509_err(hx509_context context, int exit_code,
+ int error_code, const char *fmt, ...)
{
va_list ap;
- char *msg, *str;
+ const char *msg;
+ char *str;
va_start(ap, fmt);
vasprintf(&str, fmt, ap);