btrfs-progs: Improve the parse_size() error message
commit445a3a0a51f03a3e1c35dacbd065a2c9efeadf97
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Fri, 13 Jun 2014 02:55:57 +0000 (13 10:55 +0800)
committerDavid Sterba <dsterba@suse.cz>
Fri, 22 Aug 2014 12:43:09 +0000 (22 14:43 +0200)
treed16b7c86d85a35d8c4a98b44c000250b5cedc535
parent4da2751451ffa2757f11b8433fdf02c949c5e21e
btrfs-progs: Improve the parse_size() error message

When using parse_size(), even non-numeric value is passed, it will only
give error message "ERROR: size value is empty", which is quite
confusing for end users.

This patch will introduce more meaningful error message for the
following new cases
1) Invalid size string (non-numeric string)
2) Minus size value (like "-1K")

Also this patch will take full use of endptr returned by strtoll() to
reduce unneeded loop.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
utils.c