summaryrefslogtreecommitdiff
path: root/libguile/strings.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2012-02-14 14:24:04 +0100
committerAndy Wingo <wingo@pobox.com>2012-02-14 14:24:32 +0100
commit33aadcab8a975753d757924f4eb59fe1223dfbd2 (patch)
tree87ce1c848f3d28382dabf6a57fb6ac8cde02b14a /libguile/strings.c
parent03a2eeb0cc032f48f8b789a04a41f37a6459d879 (diff)
downloadguile-33aadcab8a975753d757924f4eb59fe1223dfbd2.tar.gz
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.
Diffstat (limited to 'libguile/strings.c')
-rw-r--r--libguile/strings.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libguile/strings.c b/libguile/strings.c
index bdd0065ac..8c404a372 100644
--- a/libguile/strings.c
+++ b/libguile/strings.c
@@ -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;