mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
examples: avoid goto jump over initialization of variable
Jumping over the declaration and initialization of a variable is bad as it means the jump target sees a potentially non-initialized variable. Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
fb0d6049cc
commit
a80ba80891
@ -9,6 +9,7 @@ int main(int argc, char **argv)
|
||||
virAdmServerPtr srv = NULL; /* which server to work with */
|
||||
virTypedParameterPtr params = NULL;
|
||||
int nparams = 0;
|
||||
int maxparams = 0;
|
||||
ssize_t i;
|
||||
|
||||
if (argc != 2) {
|
||||
@ -39,7 +40,6 @@ int main(int argc, char **argv)
|
||||
nparams = 0;
|
||||
|
||||
/* set nclients_max to 100 and nclients_unauth_max to 20 */
|
||||
int maxparams = 0;
|
||||
if (virTypedParamsAddUInt(¶ms, &nparams, &maxparams,
|
||||
VIR_SERVER_CLIENTS_MAX, 100) < 0 ||
|
||||
virTypedParamsAddUInt(¶ms, &nparams, &maxparams,
|
||||
|
@ -9,6 +9,7 @@ int main(int argc, char **argv)
|
||||
virAdmServerPtr srv = NULL; /* which server to work with */
|
||||
virTypedParameterPtr params = NULL;
|
||||
int nparams = 0;
|
||||
int maxparams = 0;
|
||||
ssize_t i;
|
||||
|
||||
if (argc != 2) {
|
||||
@ -39,7 +40,6 @@ int main(int argc, char **argv)
|
||||
nparams = 0;
|
||||
|
||||
/* let's set minWorkers to 10, maxWorkers to 15 and prioWorkers to 10 */
|
||||
int maxparams = 0;
|
||||
if (virTypedParamsAddUInt(¶ms, &nparams, &maxparams,
|
||||
VIR_THREADPOOL_WORKERS_MIN, 10) < 0 ||
|
||||
virTypedParamsAddUInt(¶ms, &nparams, &maxparams,
|
||||
|
Loading…
Reference in New Issue
Block a user