diff --git a/main/gbx/gbx_string.c b/main/gbx/gbx_string.c index 1a7ad3e2b..930ddacfa 100644 --- a/main/gbx/gbx_string.c +++ b/main/gbx/gbx_string.c @@ -461,8 +461,7 @@ bool STRING_extend_will_realloc(char *str, int new_len) void STRING_new_temp_value(VALUE *value, const char *src, int len) { value->_string.addr = STRING_new_temp(src, len); - - value->_string.len = STRING_length(value->_string.addr); + value->_string.len = len; //STRING_length(value->_string.addr); value->_string.start = 0; value->type = T_STRING; } diff --git a/main/gbx/gbx_subr_file.c b/main/gbx/gbx_subr_file.c index 740b1a5ba..35ce5186a 100755 --- a/main/gbx/gbx_subr_file.c +++ b/main/gbx/gbx_subr_file.c @@ -473,7 +473,11 @@ void SUBR_read(ushort code) } else if (len > 0) { - STRING_new_temp_value(RETURN, NULL, len); + RETURN->type = T_STRING; + RETURN->_string.addr = STRING_new(NULL, len); + RETURN->_string.start = 0; + RETURN->_string.len = len; + STREAM_read(stream, RETURN->_string.addr, len); } else