rhboot / fwupdate

System firmware update support for UEFI machines
99 stars 47 forks source link

Fix uninitialized variable. #61

Closed mirco closed 7 years ago

mirco commented 7 years ago

If boot_order_size is 0, i was never set. On gcc-6.3.1, this broke the build if compiled with -O2 (-Werror=maybe_uninitialized). This is the error:

libfwup.c: In function 'set_up_boot_next': libfwup.c:818:16: error: 'i' may be used uninitialized in this function [-Werror=maybe-uninitialized] new_boot_order[i] = boot_entry; ^ libfwup.c:780:15: note: 'i' was declared here unsigned int i; ^ cc1: all warnings being treated as errors

vathpela commented 7 years ago

Thanks, I've pushed this to master.