Fix scm_to_utf8_stringn to NUL-terminate properly
authorMark H Weaver <mhw@netris.org>
Tue, 3 Apr 2012 13:50:20 +0000 (09:50 -0400)
committerMark H Weaver <mhw@netris.org>
Tue, 3 Apr 2012 13:50:20 +0000 (09:50 -0400)
* libguile/strings.c (scm_to_utf8_stringn): NUL-terminate using the
  correct pointer.

libguile/strings.c

index f4828f8..ec55c50 100644 (file)
@@ -1944,7 +1944,7 @@ scm_to_utf8_stringn (SCM str, size_t *lenp)
       else
         {
           buf = scm_malloc (predicted_len + 1);
-          ret[predicted_len] = 0;
+          buf[predicted_len] = 0;
         }
 
       ret = u32_to_u8 ((scm_t_uint32 *) scm_i_string_wide_chars (str),