mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +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];
|
||||
ch.encode_utf8(&mut data);
|
||||
if self.len() + data.len() < self.bytes.len() {
|
||||
for &c in data.iter() {
|
||||
let subslice = ch.encode_utf8(&mut data);
|
||||
if self.len() + subslice.len() < self.bytes.len() {
|
||||
for c in subslice.bytes() {
|
||||
self.bytes[self.len()] = c;
|
||||
self.len += 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue