mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-08 01:20:16 +01:00
shared/strbuf: add nm_str_buf_ensure_trailing_c() helper function
This commit is contained in:
parent
64894182ca
commit
a2d52669aa
1 changed files with 10 additions and 0 deletions
|
|
@ -129,6 +129,16 @@ void nm_str_buf_append_printf (NMStrBuf *strbuf,
|
|||
const char *format,
|
||||
...) _nm_printf (2, 3);
|
||||
|
||||
static inline void
|
||||
nm_str_buf_ensure_trailing_c (NMStrBuf *strbuf, char ch)
|
||||
{
|
||||
_nm_str_buf_assert (strbuf);
|
||||
|
||||
if ( strbuf->len == 0
|
||||
|| strbuf->_str[strbuf->len - 1] != ch)
|
||||
nm_str_buf_append_c (strbuf, ch);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue