aboutsummaryrefslogtreecommitdiffstats
path: root/gpgme/conversion.c
diff options
context:
space:
mode:
Diffstat (limited to 'gpgme/conversion.c')
-rw-r--r--gpgme/conversion.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gpgme/conversion.c b/gpgme/conversion.c
index 16854e5f..bba62bde 100644
--- a/gpgme/conversion.c
+++ b/gpgme/conversion.c
@@ -174,9 +174,11 @@ _gpgme_decode_c_string (const char *src, char **destp, size_t len)
large enough buffer is allocated with malloc and *DESTP is set to
the result. Currently, LEN is only used to specify if allocation
is desired or not, the caller is expected to make sure that *DESTP
- is large enough if LEN is not zero. */
+ is large enough if LEN is not zero. If BINARY is 1, then '\0'
+ characters are allowed in the output. */
gpgme_error_t
-_gpgme_decode_percent_string (const char *src, char **destp, size_t len)
+_gpgme_decode_percent_string (const char *src, char **destp, size_t len,
+ int binary)
{
char *dest;
@@ -222,7 +224,7 @@ _gpgme_decode_percent_string (const char *src, char **destp, size_t len)
}
else
{
- if (!val)
+ if (!val && !binary)
{
/* A binary zero is not representable in a C
string. */