Fix gcc uninitialization warning confusion

This commit is contained in:
Rodrigo Arias 2023-11-13 15:26:25 +01:00
parent 423e3b15d2
commit c7e8b256d2

View File

@ -173,9 +173,8 @@ static int
report_libovni_version(struct system *sys) report_libovni_version(struct system *sys)
{ {
int mixed = 0; int mixed = 0;
int first = 1; const char *version = NULL;
const char *version; const char *commit = NULL;
const char *commit;
for (struct thread *th = sys->threads; th; th = th->gnext) { for (struct thread *th = sys->threads; th; th = th->gnext) {
if (th->meta == NULL) { if (th->meta == NULL) {
err("thread has no metadata %s", th->id); err("thread has no metadata %s", th->id);
@ -196,11 +195,11 @@ report_libovni_version(struct system *sys)
return -1; return -1;
} }
if (first) { if (version == NULL)
version = t_version; version = t_version;
if (commit == NULL)
commit = t_commit; commit = t_commit;
first = 0;
}
if (strcmp(t_version, version) != 0) { if (strcmp(t_version, version) != 0) {
warn("thread is using a different libovni version (%s): %s", warn("thread is using a different libovni version (%s): %s",