diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | lib.c | 2 |
2 files changed, 8 insertions, 1 deletions
@@ -1,3 +1,10 @@ +2010-02-24 Kaz Kylheku <kkylheku@gmail.com> + + * 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. + 2010-01-26 Kaz Kylheku <kkylheku@gmail.com> Version 033 @@ -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; } |