common: Minor change of hex2str to allow for embedded nul.
* common/convert.c (hex2str): Set ERRNO. Return adjusted COUNT.
hex2str is only used at one place for in-place converting an hex
encoded passphrase. This change does not affect this use. The change
is however useful to use the function for in-place conversion of
arbitrary hex encoded strings.
Take care for in-place conversion of a hex string encoding binary data
you need to use it this way:
if (hex2str (string, string, strlen (string) + 1, &length) oops ("probably out of memory but see ERRNO"); for (i=0; i < length; i++) foo (string[i));
Note that strlen() + 1.
- Signed-off-by: Werner Koch <wk@gnupg.org>