mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
Display zeros in bytevectors as '0'
This commit is contained in:
parent
f9be5c8d46
commit
5519679dcd
1 changed files with 6 additions and 2 deletions
4
sexp.c
4
sexp.c
|
@ -2069,8 +2069,12 @@ sexp sexp_write_one (sexp ctx, sexp obj, sexp out) {
|
|||
for (i=0; i<(sexp_sint_t)len; i++) {
|
||||
if (i!=0) sexp_write_char(ctx, ' ', out);
|
||||
#if SEXP_BYTEVECTOR_HEX_LITERALS
|
||||
if (str[i]) {
|
||||
sprintf(buf, "#x%02hhX", ((unsigned char*) str)[i]);
|
||||
sexp_write_string(ctx, buf, out);
|
||||
} else {
|
||||
sexp_write_char (ctx, '0', out);
|
||||
}
|
||||
#else
|
||||
sexp_write(ctx, sexp_make_fixnum(((unsigned char*)str)[i]), out);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue