1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-04-01 20:05:19 +00:00

build: fix -Werror=maybe-uninitialized

When compiled with -Doptimization=g

../tools/nss/libvirt_nss_macs.c:155:8: error: ‘jerr’ may be used uninitialized [-Werror=maybe-uninitialized]
  155 |     if (jerr == json_tokener_continue) {
      |        ^

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Marc-André Lureau 2025-03-16 12:18:23 +04:00 committed by Martin Kletzander
parent 7253dda517
commit 44089b4eea
2 changed files with 2 additions and 2 deletions

View File

@ -260,7 +260,7 @@ findLeases(const char *file,
int ret = -1;
json_object *jobj = NULL;
json_tokener *tok = NULL;
enum json_tokener_error jerr;
enum json_tokener_error jerr = json_tokener_error_parse_eof;
int jsonflags = JSON_TOKENER_STRICT | JSON_TOKENER_VALIDATE_UTF8;
char line[1024];
size_t nreadTotal = 0;

View File

@ -122,7 +122,7 @@ findMACs(const char *file,
char line[1024];
json_object *jobj = NULL;
json_tokener *tok = NULL;
enum json_tokener_error jerr;
enum json_tokener_error jerr = json_tokener_error_parse_eof;
int jsonflags = JSON_TOKENER_STRICT | JSON_TOKENER_VALIDATE_UTF8;
size_t nreadTotal = 0;
int rv;