diff options
author | Thomas Haller <thaller@redhat.com> | 2021-07-16 12:03:38 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2021-07-19 09:04:49 +0200 |
commit | cf9e7ee5aa5e8ecbd0b9e3f58b1486a3dd7f88a4 (patch) | |
tree | e4148c87aff816d2b57a1728f6cfbfa67df765a0 | |
parent | fb3e6cb0dc68c1a3a89dd8a64946ecd26e545a64 (diff) | |
download | NetworkManager-cf9e7ee5aa5e8ecbd0b9e3f58b1486a3dd7f88a4.tar.gz |
libnm: use nm_ascii_is_regular() in _keyfile_key_encode()
No change in behavior.
-rw-r--r-- | src/libnm-core-impl/nm-keyfile-utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libnm-core-impl/nm-keyfile-utils.c b/src/libnm-core-impl/nm-keyfile-utils.c index 88f9c4f928..f8c2f387b0 100644 --- a/src/libnm-core-impl/nm-keyfile-utils.c +++ b/src/libnm-core-impl/nm-keyfile-utils.c @@ -531,7 +531,7 @@ _keyfile_key_encode(const char *name, char **out_to_free) if (ch == '\0') return name; - if (ch < 0x20 || ch >= 127 || NM_IN_SET(ch, '=', '[', ']') + if (!nm_ascii_is_regular(ch) || NM_IN_SET(ch, '=', '[', ']') || (ch == '\\' && g_ascii_isxdigit(name[i + 1]) && g_ascii_isxdigit(name[i + 2])) || (ch == ' ' && name[i + 1] == '\0')) break; @@ -557,7 +557,7 @@ _keyfile_key_encode(const char *name, char **out_to_free) if (ch == '\0') break; - if (ch < 0x20 || ch >= 127 || NM_IN_SET(ch, '=', '[', ']') + if (!nm_ascii_is_regular(ch) || NM_IN_SET(ch, '=', '[', ']') || (ch == '\\' && g_ascii_isxdigit(name[i + 1]) && g_ascii_isxdigit(name[i + 2])) || (ch == ' ' && name[i + 1] == '\0')) { nm_str_buf_append_c(&str, '\\'); |