From c40f22a7d831e8c8ceebb922cb6940ea6a8143a3 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Sun, 1 Sep 2002 23:29:55 +0000 Subject: [PATCH] 2002-09-02 Marcus Brinkmann * conversion.c (_gpgme_decode_c_string): Set DESTP before modifying DEST. --- gpgme/ChangeLog | 2 ++ gpgme/conversion.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index 94973731..abca388b 100644 --- a/gpgme/ChangeLog +++ b/gpgme/ChangeLog @@ -1,5 +1,7 @@ 2002-09-02 Marcus Brinkmann + * conversion.c (_gpgme_decode_c_string): Set DESTP before modifying DEST. + * conversion.c (_gpgme_decode_c_string): Fix off by one error in last change. * rungpg.c (_gpgme_append_gpg_args_from_signers): Move before _gpgme_op_edit so its prototype is known early on. diff --git a/gpgme/conversion.c b/gpgme/conversion.c index 9e1737f6..8302f991 100644 --- a/gpgme/conversion.c +++ b/gpgme/conversion.c @@ -62,6 +62,8 @@ _gpgme_decode_c_string (const char *src, char **destp) if (!dest) return mk_error (Out_Of_Core); + *destp = dest; + while (*src) { if (*src != '\\') @@ -130,7 +132,6 @@ _gpgme_decode_c_string (const char *src, char **destp) } } *(dest++) = 0; - *destp = dest; return 0; }