mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
virshParseRateStr: Use g_strsplit instead of virStringSplitCount
Count the elements after splitting the string. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
d9c3b652ef
commit
def579e88a
@ -860,10 +860,10 @@ virshParseRateStr(vshControl *ctl,
|
||||
g_auto(GStrv) tok = NULL;
|
||||
size_t ntok;
|
||||
|
||||
if (!(tok = virStringSplitCount(rateStr, ",", 0, &ntok)))
|
||||
if (!(tok = g_strsplit(rateStr, ",", 0)))
|
||||
return -1;
|
||||
|
||||
if (ntok > 4) {
|
||||
if ((ntok = g_strv_length(tok)) > 4) {
|
||||
vshError(ctl, _("Rate string '%s' has too many fields"), rateStr);
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user