aboutsummaryrefslogtreecommitdiffstats
path: root/common/convert.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2009-01-19 16:15:30 +0000
committerWerner Koch <[email protected]>2009-01-19 16:15:30 +0000
commit68fd14b144d44cc94c84fc5a4fb05a488eb06b4f (patch)
tree61fb8474e5968f1d6d2d96fd07edd3e4aca861ec /common/convert.c
parentAdd a sample key. (diff)
downloadgnupg-68fd14b144d44cc94c84fc5a4fb05a488eb06b4f.tar.gz
gnupg-68fd14b144d44cc94c84fc5a4fb05a488eb06b4f.zip
Add a few translations to the audit-log.
Diffstat (limited to 'common/convert.c')
-rw-r--r--common/convert.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/convert.c b/common/convert.c
index c946b81b1..d3e8b642e 100644
--- a/common/convert.c
+++ b/common/convert.c
@@ -194,7 +194,9 @@ hex2str (const char *hexstring, char *buffer, size_t bufsize, size_t *buflen)
;
if (*s && (!isascii (*s) || !isspace (*s)) )
return NULL; /* Not followed by Nul or white space. */
- need_nul = !(s[-2] == '0' && s[-1] == '0');
+ /* We need to append a nul character. However we don't want that if
+ the hexstring already ends with "00". */
+ need_nul = ((s == hexstring) || !(s[-2] == '0' && s[-1] == '0'));
if (need_nul)
count++;