]> git.proxmox.com Git - pve-cluster.git/commitdiff
pmxcfs: get guest cfg properties: use g_string_sized_new
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 24 Jun 2019 10:42:20 +0000 (12:42 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 24 Jun 2019 10:42:53 +0000 (12:42 +0200)
While with NULL as first argument g_string_new_len effectively
becomes a g_string_sized_new it can be confusing as the docs do not
mention that. Also this may lead to an error if one changes the call
with out to much research, so fix it to the one function we should
used to begin with here.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
data/src/status.c

index d9650bd5379e3cee9e65394fad0e6884a47f82a9..67e644933396725d7110dc83b3f7c432eb648902 100644 (file)
@@ -873,7 +873,7 @@ cfs_create_guest_conf_property_msg(GString *str, memdb_t *memdb, const char *pro
                goto ret;
        }
 
-       path = g_string_new_len(NULL, 256);
+       path = g_string_sized_new(256);
        if (vmid >= 100) {
                vminfo_t *vminfo = (vminfo_t *) g_hash_table_lookup(cfs_status.vmlist, &vmid);
                if (vminfo == NULL) goto enoent;