fix bug in printing the character #\x0

This commit is contained in:
Jeff Bezanson 2017-08-19 14:18:32 -04:00
parent 4e5319a7dc
commit b2d6548715
2 changed files with 5 additions and 1 deletions

View File

@ -635,7 +635,10 @@ static void cvalue_printdata(ios_t *f, void *data, size_t len, value_t type,
seq[nb] = '\0';
if (print_princ) {
// TODO: better multibyte handling
outs(seq, f);
if (wc == 0)
ios_putc(0, f);
else
outs(seq, f);
}
else {
outsn("#\\", f, 2);

View File

@ -78,6 +78,7 @@
(assert (equal? (uint64 (double -123)) #uint64(0xffffffffffffff85)))
(assert (equal? (string 'sym #byte(65) #wchar(945) "blah") "symA\u03B1blah"))
(assert (= (length (string #\x0)) 1))
(assert (> 9223372036854775808 9223372036854775807))