From 3d6340e8c59ee11a95e03fb213ad9b228be47833 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 16 Sep 2016 15:06:26 +0200 Subject: core: Map GPGME_STATUS_EOF to the empty string. * src/status-table.c (_gpgme_status_to_string): Return "" for EOF. * src/engine-gpg.c (read_status): Ditto. The old code accidently used GPGME_STATUS_EOF which is the integer 0 and neiteyr NULL nor a string. Signed-off-by: Werner Koch --- src/engine-gpg.c | 3 +-- src/status-table.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/engine-gpg.c b/src/engine-gpg.c index a7431d56..025657a9 100644 --- a/src/engine-gpg.c +++ b/src/engine-gpg.c @@ -1095,8 +1095,7 @@ read_status (engine_gpg_t gpg) err = 0; gpg->status.eof = 1; if (gpg->status.mon_cb) - err = gpg->status.mon_cb (gpg->status.mon_cb_value, - GPGME_STATUS_EOF, ""); + err = gpg->status.mon_cb (gpg->status.mon_cb_value, "", ""); if (gpg->status.fnc) { char emptystring[1] = {0}; diff --git a/src/status-table.c b/src/status-table.c index f44a08fb..c9bf3577 100644 --- a/src/status-table.c +++ b/src/status-table.c @@ -178,6 +178,6 @@ _gpgme_status_to_string (gpgme_status_code_t code) for (i=0; i < DIM(status_table); i++) if (status_table[i].code == code) - return status_table[i].name; + return status_table[i].name? status_table[i].name : ""; return "status_code_lost"; } -- cgit v1.2.3