mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-22 06:50:39 +01:00
glib-aux: add nm_str_buf_utf8_validate() helper
(cherry picked from commit b15dfe0365)
This commit is contained in:
parent
bbfdbf5f76
commit
c5f8173072
1 changed files with 7 additions and 0 deletions
|
|
@ -504,4 +504,11 @@ nm_str_buf_destroy(NMStrBuf *strbuf)
|
|||
|
||||
#define nm_auto_str_buf nm_auto(nm_str_buf_destroy)
|
||||
|
||||
static inline gboolean
|
||||
nm_str_buf_utf8_validate(NMStrBuf *strbuf)
|
||||
{
|
||||
_nm_str_buf_assert(strbuf);
|
||||
return strbuf->_priv_len == 0 || g_utf8_validate(strbuf->_priv_str, strbuf->_priv_len, NULL);
|
||||
}
|
||||
|
||||
#endif /* __NM_STR_BUF_H__ */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue