as text_version is a char array (not a pointer), testing the
address against NULL is the wrong thing to do. Test the
content instead.
Signed-off-by: NeilBrown <neilb@suse.de>
if (sra)
sysfs_free(sra);
sra = sysfs_read(-1, devnum, GET_VERSION);
if (sra)
sysfs_free(sra);
sra = sysfs_read(-1, devnum, GET_VERSION);
- verstr = sra->text_version ? : "-no-metadata-";
+ if (sra && sra->text_version[0])
+ verstr = sra->text_version;
+ else
+ verstr = "-no-metadata-";
}
for (i = 0; st == NULL && superlist[i] ; i++)
}
for (i = 0; st == NULL && superlist[i] ; i++)