diff --git a/libguile/strports.c b/libguile/strports.c index 821a04c4b..4cb2b9119 100644 --- a/libguile/strports.c +++ b/libguile/strports.c @@ -199,8 +199,8 @@ scm_mkstrport (SCM pos, SCM str, long modes, const char *caller) else /* Inefficient but simple way to convert the character position POS into a byte position BYTE_POS. */ - free (scm_to_utf8_stringn (scm_substring (str, SCM_INUM0, pos), - &byte_pos)); + byte_pos = scm_c_string_utf8_length + (scm_substring (str, SCM_INUM0, pos)); } stream = scm_gc_typed_calloc (struct string_port);