mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Fix off by one bug introduced in the previous commit.
This commit is contained in:
@@ -791,7 +791,7 @@ utf8_to_utf16 :: proc(s: string, allocator := context.temp_allocator) -> []u16 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
text[n] = 0;
|
text[n] = 0;
|
||||||
for n >= 0 && text[n] == 0 {
|
for n >= 1 && text[n-1] == 0 {
|
||||||
n -= 1;
|
n -= 1;
|
||||||
}
|
}
|
||||||
return text[:n];
|
return text[:n];
|
||||||
@@ -823,7 +823,7 @@ utf16_to_utf8 :: proc(s: []u16, allocator := context.temp_allocator) -> string {
|
|||||||
|
|
||||||
text[n] = 0;
|
text[n] = 0;
|
||||||
|
|
||||||
for n >= 0 && text[n] == 0 {
|
for n >= 1 && text[n-1] == 0 {
|
||||||
n -= 1;
|
n -= 1;
|
||||||
}
|
}
|
||||||
return string(text[:n]);
|
return string(text[:n]);
|
||||||
|
|||||||
Reference in New Issue
Block a user