diff options
-rw-r--r-- | mdadm.h | 2 | ||||
-rw-r--r-- | util.c | 9 |
2 files changed, 6 insertions, 5 deletions
@@ -1156,7 +1156,7 @@ extern unsigned long bitmap_sectors(struct bitmap_super_s *bsb); extern int md_get_version(int fd); extern int get_linux_version(void); extern int mdadm_version(char *version); -extern long long parse_size(char *size); +extern unsigned long long parse_size(char *size); extern int parse_uuid(char *str, int uuid[4]); extern int parse_layout_10(char *layout); extern int parse_layout_faulty(char *layout); @@ -188,13 +188,13 @@ int mdadm_version(char *version) return (a*1000000)+(b*1000)+c; } -long long parse_size(char *size) +unsigned long long parse_size(char *size) { /* parse 'size' which should be a number optionally * followed by 'K', 'M', or 'G'. * Without a suffix, K is assumed. * Number returned is in sectors (half-K) - * -1 returned on error. + * 0 returned on error. */ char *c; long long s = strtoll(size, &c, 10); @@ -214,9 +214,10 @@ long long parse_size(char *size) s *= 1024 * 1024 * 2; break; } - } + } else + s = 0; if (*c) - s = -1; + s = 0; return s; } |