From: Coly Li Date: Fri, 3 Mar 2023 16:21:30 +0000 (+0800) Subject: util.c: reorder code lines in parse_layout_faulty() X-Git-Tag: mdadm-4.3~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0151041642dffff2421c22e18fb7b02b58787d9;p=thirdparty%2Fmdadm.git util.c: reorder code lines in parse_layout_faulty() Resort the code lines in parse_layout_faulty() to make it more comfortable, no logic change. Signed-off-by: Coly Li Reviewed-by: Paul Menzel Signed-off-by: Jes Sorensen --- diff --git a/util.c b/util.c index 7fc881bf..b0b7aec4 100644 --- a/util.c +++ b/util.c @@ -421,12 +421,15 @@ int parse_layout_10(char *layout) int parse_layout_faulty(char *layout) { + int ln, mode; + char *m; + if (!layout) return -1; + /* Parse the layout string for 'faulty' */ - int ln = strcspn(layout, "0123456789"); - char *m = xstrdup(layout); - int mode; + ln = strcspn(layout, "0123456789"); + m = xstrdup(layout); m[ln] = 0; mode = map_name(faultylayout, m); if (mode == UnSet)