From: Thomas Lamprecht Date: Mon, 24 Jun 2019 10:42:20 +0000 (+0200) Subject: pmxcfs: get guest cfg properties: use g_string_sized_new X-Git-Url: https://git.proxmox.com/?p=pve-cluster.git;a=commitdiff_plain;h=5b17ee167172f2afd3dd162587ad415f91f56265;hp=9c2c6bb500692063549803ef361994ad844f6774 pmxcfs: get guest cfg properties: use g_string_sized_new 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 --- diff --git a/data/src/status.c b/data/src/status.c index d9650bd..67e6449 100644 --- a/data/src/status.c +++ b/data/src/status.c @@ -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;