diff options
author | Werner Koch <wk@gnupg.org> | 2018-02-22 16:19:56 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2018-02-22 16:19:56 +0100 |
commit | 20539ea5cad1903352e01ef95aecdda4d5cd999b (patch) | |
tree | 609042662948bcd256dd4400b64bdb5e656173e4 /g13 | |
parent | build: Update autogen.sh to set a git PATCH prefix. (diff) | |
parent | Post release updates. (diff) | |
download | gnupg2-20539ea5cad1903352e01ef95aecdda4d5cd999b.tar.xz gnupg2-20539ea5cad1903352e01ef95aecdda4d5cd999b.zip |
Merge branch 'STABLE-BRANCH-2-2'
Diffstat (limited to 'g13')
-rw-r--r-- | g13/server.c | 21 | ||||
-rw-r--r-- | g13/sh-cmd.c | 28 |
2 files changed, 7 insertions, 42 deletions
diff --git a/g13/server.c b/g13/server.c index bbe42d4f6..defde6c02 100644 --- a/g13/server.c +++ b/g13/server.c @@ -34,6 +34,7 @@ #include "mount.h" #include "suspend.h" #include "../common/server-help.h" +#include "../common/asshelp.h" #include "../common/call-gpg.h" @@ -737,24 +738,8 @@ g13_status (ctrl_t ctrl, int no, ...) } else { - assuan_context_t ctx = ctrl->server_local->assuan_ctx; - char buf[950], *p; - size_t n; - - p = buf; - n = 0; - while ( (text = va_arg (arg_ptr, const char *)) ) - { - if (n) - { - *p++ = ' '; - n++; - } - for ( ; *text && n < DIM (buf)-2; n++) - *p++ = *text++; - } - *p = 0; - err = assuan_write_status (ctx, get_status_string (no), buf); + err = vprint_assuan_status_strings (ctrl->server_local->assuan_ctx, + get_status_string (no), arg_ptr); } va_end (arg_ptr); diff --git a/g13/sh-cmd.c b/g13/sh-cmd.c index b57369d9c..791e3b7f4 100644 --- a/g13/sh-cmd.c +++ b/g13/sh-cmd.c @@ -28,6 +28,7 @@ #include "g13-syshelp.h" #include <assuan.h> #include "../common/i18n.h" +#include "../common/asshelp.h" #include "keyblob.h" @@ -904,34 +905,13 @@ sh_encrypt_keyblob (ctrl_t ctrl, const void *keyblob, size_t keybloblen, gpg_error_t g13_status (ctrl_t ctrl, int no, ...) { - gpg_error_t err = 0; + gpg_error_t err; va_list arg_ptr; - const char *text; va_start (arg_ptr, no); - if (1) - { - assuan_context_t ctx = ctrl->server_local->assuan_ctx; - char buf[950], *p; - size_t n; - - p = buf; - n = 0; - while ( (text = va_arg (arg_ptr, const char *)) ) - { - if (n) - { - *p++ = ' '; - n++; - } - for ( ; *text && n < DIM (buf)-2; n++) - *p++ = *text++; - } - *p = 0; - err = assuan_write_status (ctx, get_status_string (no), buf); - } - + err = vprint_assuan_status_strings (ctrl->server_local->assuan_ctx, + get_status_string (no), arg_ptr); va_end (arg_ptr); return err; } |