shared: avoid copying empty string in nm_str_buf_append_printf()

This commit is contained in:
Thomas Haller 2020-06-21 22:40:17 +02:00
parent d0a2eb8f05
commit 081650eb67
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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);