@miconda commented on this pull request.
In src/modules/cfg_rpc/cfg_rpc.c:
> + str group, var; + void *val; + unsigned int val_type; + int ret, n; + unsigned int *group_id; + + n = rpc->scan(c, "SS", &group, &var); + /* 2: both group and variable name are present + * -1: only group is present, print all variables in the group */ + if(n<2) { + if (n == -1) { + var.s = NULL; + var.len = 0; + } + else return; + }
I think that the right way is to read with optional specifier *
:
n = rpc->scan(c, "S*S", &group, &var);
The n is two if both were read or 1 if only group is read.
When n is -1, there can be other errors.
Otherwise, the patch is useful, thanks!
Can you do a new patch based on what I suggested? It can be a follow up of this one, we can squash from the web when merging.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.