* common/convert.c (hex2fixedbuf): New.
--
This function is useful for converting hex strings received via assuan
if they have a known length. For example keygrips or the new UBID.
Signed-off-by: Werner Koch <wk@gnupg.org>
* 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>
We better do this once and for all instead of cluttering all future
commits with diffs of trailing white spaces. In the majority of cases
blank or single lines are affected and thus this change won't disturb
a git blame too much. For future commits the pre-commit scripts
checks that this won't happen again.