mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-28 20:20:09 +01:00
shared: avoid copying empty string in nm_str_buf_append_printf()
This commit is contained in:
parent
d0a2eb8f05
commit
081650eb67
1 changed files with 6 additions and 1 deletions
|
|
@ -4966,7 +4966,12 @@ nm_str_buf_append_printf (NMStrBuf *strbuf,
|
|||
nm_assert (l < G_MAXINT);
|
||||
|
||||
if ((gsize) l >= available) {
|
||||
gsize l2 = ((gsize) l) + 1u;
|
||||
gsize l2;
|
||||
|
||||
if (l == 0)
|
||||
return;
|
||||
|
||||
l2 = ((gsize) l) + 1u;
|
||||
|
||||
nm_str_buf_maybe_expand (strbuf, l2, FALSE);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue