mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-28 21:30:10 +01:00
shared: add nm_str_buf_append_c_repeated() helper
(cherry picked from commit a2142e884b)
This commit is contained in:
parent
3ed95f308f
commit
4c443ec269
1 changed files with 13 additions and 0 deletions
|
|
@ -166,6 +166,19 @@ nm_str_buf_erase (NMStrBuf *strbuf,
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
static inline void
|
||||
nm_str_buf_append_c_repeated (NMStrBuf *strbuf,
|
||||
char ch,
|
||||
guint len)
|
||||
{
|
||||
if (len > 0) {
|
||||
nm_str_buf_maybe_expand (strbuf, len + 1, FALSE);
|
||||
do {
|
||||
strbuf->_priv_str[strbuf->_priv_len++] = ch;
|
||||
} while (--len > 0);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
nm_str_buf_append_c (NMStrBuf *strbuf,
|
||||
char ch)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue