From 647ec2123df81073de01a1799393fb1dbf738c29 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 24 Feb 2010 00:13:08 -0800 Subject: * lib.c (init_str): Bugfix: copy only len characters, not len + 1, so that we don't clobber the null terminator in the target string, or try read past the end of the source data. This affects the @(freeform) directive. --- lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib.c') diff --git a/lib.c b/lib.c index 30d7b661..3135d57f 100644 --- a/lib.c +++ b/lib.c @@ -791,7 +791,7 @@ val mkustring(val len) val init_str(val str, const wchar_t *data) { - wmemcpy(str->st.str, data, c_num(str->st.len) + 1); + wmemcpy(str->st.str, data, c_num(str->st.len)); return str; } -- cgit v1.2.3