mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-23 00:00:02 +03:00
fixup! cmd_format: fix --version
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
626b1945eb
commit
83cc57700f
@ -734,9 +734,16 @@ unsigned version_parse(char *buf)
|
|||||||
|
|
||||||
unsigned major, minor;
|
unsigned major, minor;
|
||||||
|
|
||||||
if (kstrtouint(major_str, 10, &major) ||
|
if (!minor_str) {
|
||||||
kstrtouint(minor_str, 10, &minor))
|
major = 0;
|
||||||
die("invalid version");
|
if (kstrtouint(major_str, 10, &minor))
|
||||||
|
die("invalid version %s", buf);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (kstrtouint(major_str, 10, &major) ||
|
||||||
|
kstrtouint(minor_str, 10, &minor))
|
||||||
|
die("invalid version %s", buf);
|
||||||
|
}
|
||||||
|
|
||||||
return BCH_VERSION(major, minor);
|
return BCH_VERSION(major, minor);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user