Fix scm_to_utf8_stringn once and for all; optimize; add tests
authorMark H Weaver <mhw@netris.org>
Wed, 4 Apr 2012 22:58:44 +0000 (18:58 -0400)
committerMark H Weaver <mhw@netris.org>
Wed, 4 Apr 2012 22:58:44 +0000 (18:58 -0400)
commitbbb9f000ad52282ee1a0518b65437baf20c3d17c
tree270f1ab225107ae8cb2a58fe5e8259877d6ab5ea
parent51853eee69ca5811ae0661eb91868121c6ad1d74
Fix scm_to_utf8_stringn once and for all; optimize; add tests

* libguile/strings.c (scm_to_utf8_stringn): Fix another new bug in this
  recent comedy of errors: pass the size of the preallocated buffer to
  u32_to_u8.  Arrange to call 'scm_i_string_wide_chars' and
  'scm_i_string_length' only once each.  Rename local variables for
  improved code clarity.

* test-suite/standalone/test-conversion.c (test_to_utf8_stringn): New
  function to test scm_to_utf8_stringn.
libguile/strings.c
test-suite/standalone/test-conversion.c