fixing offby1 bug in utf8 encoder

This commit is contained in:
Alex Shinn 2011-04-04 10:13:31 -04:00
parent ac0d0bb300
commit c75ad29100

2
eval.c
View file

@ -1225,7 +1225,7 @@ void sexp_write_utf8_char (sexp ctx, int c, sexp out) {
unsigned char buf[8]; unsigned char buf[8];
int len = sexp_utf8_char_byte_count(c); int len = sexp_utf8_char_byte_count(c);
sexp_utf8_encode_char(buf, len, c); sexp_utf8_encode_char(buf, len, c);
buf[len+1] = 0; buf[len] = 0;
sexp_write_string(ctx, (char*)buf, out); sexp_write_string(ctx, (char*)buf, out);
} }