mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 10:18:15 +09:00
LibC: Specifically clear only stored bytes after successful mbrtowc
This commit is contained in:
parent
06f30943ef
commit
212f9308d4
Notes:
sideshowbarker
2024-07-18 03:10:07 +09:00
Author: https://github.com/timschumi
Commit: 212f9308d4
Pull-request: https://github.com/SerenityOS/serenity/pull/10170
Reviewed-by: https://github.com/BertalanD ✅
Reviewed-by: https://github.com/Hendiadyoin1
Reviewed-by: https://github.com/IdanHo
Reviewed-by: https://github.com/kleinesfilmroellchen
1 changed files with 2 additions and 2 deletions
|
@ -280,8 +280,8 @@ size_t mbrtowc(wchar_t* pwc, const char* s, size_t n, mbstate_t* state)
|
|||
*pwc = codepoint;
|
||||
}
|
||||
|
||||
// We don't have a shift state that we need to keep, so just clear the entire state
|
||||
*state = {};
|
||||
// We want to read the next multibyte character, but keep all other properties.
|
||||
state->stored_bytes = 0;
|
||||
|
||||
if (codepoint == 0) {
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue