We usually check lookup() return value. Let's do it in this case too.
It seems static analyzers will be happy with consistent code.
Signed-off-by: Karel Zak <kzak@redhat.com>
read_physical_info_powerpc(desc);
if ((fp = ul_path_fopen(desc->procfs, "r", "sysinfo"))) {
- while (fgets(buf, sizeof(buf), fp) != NULL && !desc->machinetype)
- lookup(buf, "Type", &desc->machinetype);
+ while (fgets(buf, sizeof(buf), fp) != NULL) {
+ if (lookup(buf, "Type", &desc->machinetype))
+ break;
+ }
fclose(fp);
}