shared: avoid copying empty string in nm_str_buf_append_printf()

(cherry picked from commit 081650eb67)
This commit is contained in:
Thomas Haller 2020-06-21 22:40:17 +02:00
parent 27c84a505c
commit bf9ea4ea71
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -4948,7 +4948,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);