gpgscm: Fix printing strings containing zero bytes.

* tests/gpgscm/scheme.c (atom2str): Fix computing the length of Scheme
strings.  Scheme strings can contain zero bytes.

Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
Justus Winter 2016-11-04 13:45:30 +01:00
parent 43f8006f5c
commit 1f45878a72
1 changed files with 3 additions and 1 deletions

View File

@ -2041,7 +2041,9 @@ static void atom2str(scheme *sc, pointer l, int f, char **pp, int *plen) {
}
} else if (is_string(l)) {
if (!f) {
p = strvalue(l);
*pp = strvalue(l);
*plen = strlength(l);
return;
} else { /* Hack, uses the fact that printing is needed */
*pp=sc->strbuff;
*plen=0;