From: NeilBrown Date: Mon, 11 May 2009 05:21:43 +0000 (+1000) Subject: util: fix test for text_version X-Git-Tag: mdadm-3.0-rc1~17 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fmdadm.git;a=commitdiff_plain;h=603f24a05f48063a7239e323e2aeab497cb0feb6 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 --- diff --git a/util.c b/util.c index 35bb91bb..dddcc8b3 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++)