mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
lib: Substitute some STREQLEN with STRPREFIX
There are few cases where STREQLEN() is called like this: STREQLEN(var, string, strlen(string)) which is the same as STRPREFIX(var, string). Use STRPREFIX() because it is more obvious what the check is doing. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
@@ -2568,7 +2568,6 @@ static char **
|
||||
vshReadlineCommandGenerator(const char *text)
|
||||
{
|
||||
size_t grp_list_index = 0, cmd_list_index = 0;
|
||||
size_t len = strlen(text);
|
||||
const char *name;
|
||||
const vshCmdGrp *grp;
|
||||
const vshCmdDef *cmds;
|
||||
@@ -2588,7 +2587,7 @@ vshReadlineCommandGenerator(const char *text)
|
||||
if (cmds[cmd_list_index++].flags & VSH_CMD_FLAG_ALIAS)
|
||||
continue;
|
||||
|
||||
if (STREQLEN(name, text, len)) {
|
||||
if (STRPREFIX(name, text)) {
|
||||
if (VIR_REALLOC_N(ret, ret_size + 2) < 0) {
|
||||
g_strfreev(ret);
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user