mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
fix push() function on string
didn't hnadle variable length encoding of the utf8 correctly
This commit is contained in:
parent
cb0686803e
commit
161b1943eb
1 changed files with 3 additions and 3 deletions
|
|
@ -105,9 +105,9 @@ impl<const N: usize> String<N> {
|
||||||
},
|
},
|
||||||
_ => {
|
_ => {
|
||||||
let mut data: [u8; 4] = [0; 4];
|
let mut data: [u8; 4] = [0; 4];
|
||||||
ch.encode_utf8(&mut data);
|
let subslice = ch.encode_utf8(&mut data);
|
||||||
if self.len() + data.len() < self.bytes.len() {
|
if self.len() + subslice.len() < self.bytes.len() {
|
||||||
for &c in data.iter() {
|
for c in subslice.bytes() {
|
||||||
self.bytes[self.len()] = c;
|
self.bytes[self.len()] = c;
|
||||||
self.len += 1;
|
self.len += 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue