fix string-ref' and
bytes-ref' error message
Closes PR 11064, since the problem that triggered the bad error message is also fixed
This commit is contained in:
parent
15381e761a
commit
07a7916142
|
@ -960,7 +960,8 @@ void scheme_out_of_string_range(const char *name, const char *which,
|
|||
"%s: %sindex %s out of range [%d, %d] for %s%s: %t",
|
||||
name, which,
|
||||
scheme_make_provided_string(i, 2, NULL),
|
||||
start, len,
|
||||
((start < 0) ? 0 : start),
|
||||
((start < 0) ? (len - 1) : len),
|
||||
is_byte ? "byte-" : "",
|
||||
SCHEME_CHAPERONE_VECTORP(s) ? "vector" : "string",
|
||||
sstr, slen);
|
||||
|
|
|
@ -245,7 +245,7 @@ X_(scheme_checked, string_ref) (int argc, Scheme_Object *argv[])
|
|||
i = scheme_extract_index(XSTRINGSTR "-ref", 1, argc, argv, len, 0);
|
||||
|
||||
if (i >= len) {
|
||||
scheme_out_of_string_range(XSTRINGSTR "-ref", "", argv[1], argv[0], 0, len - 1);
|
||||
scheme_out_of_string_range(XSTRINGSTR "-ref", "", argv[1], argv[0], -1, len);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user