From f4344d6261e2917abe446bb89dc95af666c92ab2 Mon Sep 17 00:00:00 2001 From: antona Date: Mon, 27 Mar 2006 22:39:38 +0000 Subject: [PATCH] Change utils_parse_size() to use a base of 0 instead of 10 when calling strtoll(). This automagically allows specification of numbers in hex (and octal if anyone is crazy enough to use that) in addition to decimal numbers on the command line options to most if not all utilities. (Anton) --- ChangeLog | 5 +++++ ntfsprogs/utils.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3db4a804..57519a4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,11 @@ xx/xx/2006 - 1.13.1-WIP index allocation attributes as well. This further decreases the compressed metadata image size by 10-25% and more importantly it eliminates non-interesting ntfscmp differences. (Szaka) + - Change utils_parse_size() to use a base of 0 instead of 10 when + calling strtoll(). This automagically allows specification of + numbers in hex (and octal if anyone is crazy enough to use that) in + addition to decimal numbers on the command line options to most if + not all utilities. (Anton) 27/02/2006 - 1.13.0 - Lots and lots and lots of fixes and enhancements. diff --git a/ntfsprogs/utils.c b/ntfsprogs/utils.c index 2be2bc53..72b77844 100644 --- a/ntfsprogs/utils.c +++ b/ntfsprogs/utils.c @@ -211,6 +211,7 @@ ntfs_volume * utils_mount_volume(const char *device, unsigned long flags, BOOL f } #endif + /** * utils_parse_size - Convert a string representing a size * @value: String to be parsed @@ -246,7 +247,7 @@ int utils_parse_size(const char *value, s64 *size, BOOL scale) ntfs_log_debug("Parsing size '%s'.\n", value); - result = strtoll(value, &suffix, 10); + result = strtoll(value, &suffix, 0); if (result < 0 || errno == ERANGE) { ntfs_log_error("Invalid size '%s'.\n", value); return 0;