mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
examples: hellolibvirt: fix argc check
https://gitlab.com/libvirt/libvirt/-/issues/255 Reported-by: Jeremy Alcim Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
497e6f5fa6
commit
dacf616b78
@ -107,11 +107,12 @@ main(int argc, char *argv[])
|
||||
{
|
||||
int ret = 0;
|
||||
virConnectPtr conn;
|
||||
char *uri;
|
||||
char *uri = NULL;
|
||||
|
||||
printf("Attempting to connect to hypervisor\n");
|
||||
|
||||
uri = (argc > 0 ? argv[1] : NULL);
|
||||
if (argc > 1)
|
||||
uri = argv[1];
|
||||
|
||||
/* virConnectOpenAuth is called here with all default parameters,
|
||||
* except, possibly, the URI of the hypervisor. */
|
||||
|
Loading…
Reference in New Issue
Block a user