summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-05-11 15:21:43 +1000
committerNeilBrown <neilb@suse.de>2009-05-11 15:21:43 +1000
commit603f24a05f48063a7239e323e2aeab497cb0feb6 (patch)
treee6d0b2125d5f75fdfc3cb40a7f33c353f1b37274
parent05833051ee595c8d356a2a1ed61f7d9e6f4186ef (diff)
downloadmdadm-603f24a05f48063a7239e323e2aeab497cb0feb6.tar.gz
mdadm-603f24a05f48063a7239e323e2aeab497cb0feb6.tar.xz
mdadm-603f24a05f48063a7239e323e2aeab497cb0feb6.zip
util: fix test for text_version
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>
-rw-r--r--util.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/util.c b/util.c
index 35bb91b..dddcc8b 100644
--- a/util.c
+++ b/util.c
@@ -916,7 +916,10 @@ struct supertype *super_by_fd(int fd)
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++)