1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

fix buggy scm_from_utf8_stringn (!)

* libguile/strings.c (scm_from_utf8_stringn): Embarassingly, my
  scm_from_utf8_stringn implementation was buggy for non-ascii
  characters, since October (41d1d984).  Fixed.  Will be tested with the
  next patch.
This commit is contained in:
Andy Wingo 2012-02-14 14:24:04 +01:00
parent 03a2eeb0cc
commit 33aadcab8a

View file

@ -1669,7 +1669,7 @@ scm_from_utf8_stringn (const char *str, size_t len)
res = scm_i_make_string (char_len, &dst, 0);
for (i = 0, j = 0; i < len; i++, j++)
for (i = 0, j = 0; i < len; j++)
{
i += u8_mbtouc_unsafe (&c, ustr + i, len - i);
dst[j] = (signed char) c;
@ -1683,7 +1683,7 @@ scm_from_utf8_stringn (const char *str, size_t len)
res = scm_i_make_wide_string (char_len, &dst, 0);
for (i = 0, j = 0; i < len; i++, j++)
for (i = 0, j = 0; i < len; j++)
{
i += u8_mbtouc_unsafe (&c, ustr + i, len - i);
dst[j] = c;