aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpgme.c
diff options
context:
space:
mode:
authorBen Kibbey <[email protected]>2015-08-15 20:58:04 +0000
committerBen Kibbey <[email protected]>2015-08-15 22:19:27 +0000
commit70b3e5964ea0592bd09d1877d720b2c63f501970 (patch)
treeca59bd5aeb499a0138dcecd6a72ed6ed80476c84 /src/gpgme.c
parentParse the INQUIRE_MAXLEN status message. (diff)
downloadgpgme-70b3e5964ea0592bd09d1877d720b2c63f501970.tar.gz
gpgme-70b3e5964ea0592bd09d1877d720b2c63f501970.zip
Fix gpgme_{get,set}_status_cb to match documentation.
* doc/gpgme.texi: Minor fixes. * src/gpgme.c (gpgme_get_status_cb): Set return variables to NULL and check for a valid ctx pointer.
Diffstat (limited to 'src/gpgme.c')
-rw-r--r--src/gpgme.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gpgme.c b/src/gpgme.c
index 9c09827e..0cf999a7 100644
--- a/src/gpgme.c
+++ b/src/gpgme.c
@@ -679,7 +679,17 @@ gpgme_get_status_cb (gpgme_ctx_t ctx, gpgme_status_cb_t *r_cb,
void **r_cb_value)
{
TRACE2 (DEBUG_CTX, "gpgme_get_status_cb", ctx, "ctx->status_cb=%p/%p",
- ctx->status_cb, ctx->status_cb_value);
+ ctx ? ctx->status_cb : NULL, ctx ? ctx->status_cb_value : NULL);
+
+ if (r_cb)
+ *r_cb = NULL;
+
+ if (r_cb_value)
+ *r_cb_value = NULL;
+
+ if (!ctx || !ctx->status_cb)
+ return;
+
if (r_cb)
*r_cb = ctx->status_cb;
if (r_cb_value)