Reading a fixed number of bytes with READ does not crash anymore if an "End of file" error is raised.
[INTERPRETER] * BUG: Reading a fixed number of bytes with READ does not crash anymore if an "End of file" error is raised.
This commit is contained in:
parent
8200600168
commit
b5edf09de9
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user