summaryrefslogtreecommitdiffstats
path: root/stream.c
diff options
context:
space:
mode:
Diffstat (limited to 'stream.c')
-rw-r--r--stream.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/stream.c b/stream.c
index 1f6a6bde..415991a8 100644
--- a/stream.c
+++ b/stream.c
@@ -1690,10 +1690,8 @@ val make_string_byte_input_stream(val string)
{
struct byte_input *bi = coerce(struct byte_input *, chk_malloc(sizeof *bi));
- unsigned char *utf8 = utf8_dup_to_uc(c_str(string));
strm_base_init(&bi->a);
- bi->buf = utf8;
- bi->size = strlen(coerce(char *, utf8));
+ bi->buf = utf8_dup_to_buf(c_str(string), &bi->size, 0);
bi->index = 0;
return cobj(coerce(mem_t *, bi), stream_s, &byte_in_ops.cobj_ops);
}