mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-11 06:00:35 +01:00
platform: fix nm_platform_qdisc_to_string()
When using nm_utils_strbuf_*() API, the buffer gets always moved to the current end. We must thus remember and return the original start of the buffer.
This commit is contained in:
parent
a1099a1fab
commit
b658e3da08
1 changed files with 4 additions and 1 deletions
|
|
@ -6427,10 +6427,13 @@ const char *
|
|||
nm_platform_qdisc_to_string (const NMPlatformQdisc *qdisc, char *buf, gsize len)
|
||||
{
|
||||
char str_dev[TO_STRING_DEV_BUF_SIZE];
|
||||
const char *buf0;
|
||||
|
||||
if (!nm_utils_to_string_buffer_init_null (qdisc, &buf, &len))
|
||||
return buf;
|
||||
|
||||
buf0 = buf;
|
||||
|
||||
nm_utils_strbuf_append (&buf, &len, "%s%s family %u handle %x parent %x info %x",
|
||||
qdisc->kind,
|
||||
_to_string_dev (NULL, qdisc->ifindex, str_dev, sizeof (str_dev)),
|
||||
|
|
@ -6458,7 +6461,7 @@ nm_platform_qdisc_to_string (const NMPlatformQdisc *qdisc, char *buf, gsize len)
|
|||
nm_utils_strbuf_append (&buf, &len, " ecn");
|
||||
}
|
||||
|
||||
return buf;
|
||||
return buf0;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue