mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 21:10:08 +01:00
libnm: use nm_ascii_is_ctrl_or_del() in nm_utils_fixup_product_string() to preserve UTF-8
On architectures where "char" is signed, the check "ch < ' '" is also TRUE for characters greater than 127 (that is, UTF-8 characters). Let's preserve valid UTF-8 characters and don't clear them. Also note that already before we filtered out invalid UTF-8 sequences, so if we encounter here a character > 127, it is part of a valid UTF-8 sequence.
This commit is contained in:
parent
17bdd3a40d
commit
fb3e6cb0dc
1 changed files with 1 additions and 1 deletions
|
|
@ -166,7 +166,7 @@ _fixup_string(const char * desc,
|
|||
in_paren = TRUE;
|
||||
else if (*p == ')')
|
||||
in_paren = FALSE;
|
||||
else if (NM_IN_SET(*p, '_', ',') || *p < ' ' || in_paren) {
|
||||
else if (NM_IN_SET(*p, '_', ',') || nm_ascii_is_ctrl_or_del(*p) || in_paren) {
|
||||
/* pass */
|
||||
} else
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue