On Wed, Feb 19, 2014 at 07:17:51PM +0800, Wang Shilong wrote:
+u64 btrfs_strtoull(char *str, int base)
+{
+ u64 value;
+ char *ptr_parse_end = NULL;
+ char *ptr_str_end = str + strlen(str);
+
+ value = strtoull(str, ptr_parse_end, base);
+ if (ptr_parse_end !=
There are many places that need parse string to u64 for btrfs commands,
in fact, we do such things *too casually*, using atoi/atol/atoll..is not
right at all, and even we don't check whether it is a valid string.
Let's do everything more gracefully, we introduce a new helper
btrfs_strtoull()
On Wed, 19 Feb 2014 19:17:51 +0800, Wang Shilong wrote:
There are many places that need parse string to u64 for btrfs commands,
in fact, we do such things *too casually*, using atoi/atol/atoll..is not
right at all, and even we don't check whether it is a valid string.
Let's do everything
Hello Stefan,
On Wed, 19 Feb 2014 19:17:51 +0800, Wang Shilong wrote:
There are many places that need parse string to u64 for btrfs commands,
in fact, we do such things *too casually*, using atoi/atol/atoll..is not
right at all, and even we don't check whether it is a valid string.
Let's
Hi Wang,
On 02/19/2014 12:17 PM, Wang Shilong wrote:
There are many places that need parse string to u64 for btrfs commands,
in fact, we do such things *too casually*, using atoi/atol/atoll..is not
right at all, and even we don't check whether it is a valid string.
Let's do everything more
Hi Goffredo,
Hi Wang,
On 02/19/2014 12:17 PM, Wang Shilong wrote:
There are many places that need parse string to u64 for btrfs commands,
in fact, we do such things *too casually*, using atoi/atol/atoll..is not
right at all, and even we don't check whether it is a valid string.
Let's do
Hi Wang,
On 02/19/2014 05:08 PM, Wang Shilong wrote:
Hi Goffredo,
Hi Wang,
On 02/19/2014 12:17 PM, Wang Shilong wrote:
There are many places that need parse string to u64 for btrfs commands,
in fact, we do such things *too casually*, using atoi/atol/atoll..is not
right at all, and even we
Hi Goffredo,
Hi Wang,
On 02/19/2014 05:08 PM, Wang Shilong wrote:
Hi Goffredo,
Hi Wang,
On 02/19/2014 12:17 PM, Wang Shilong wrote:
There are many places that need parse string to u64 for btrfs commands,
in fact, we do such things *too casually*, using atoi/atol/atoll..is not
right
On 2/19/14, 10:31 AM, Goffredo Baroncelli wrote:
...
The error message says that the value is out of range. But doesn't tell which
is the parameter involved.
If you have a command which has several arguments, and the user pass a string
instead of a number, the error returned doesn't tell
On 02/20/2014 01:23 AM, Eric Sandeen wrote:
On 2/19/14, 10:31 AM, Goffredo Baroncelli wrote:
...
The error message says that the value is out of range. But doesn't tell which
is the parameter involved.
If you have a command which has several arguments, and the user pass a string
instead of
10 matches
Mail list logo