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)
edge.strict_endians
antona 2006-03-27 22:39:38 +00:00
parent b4fa78dc58
commit f4344d6261
2 changed files with 7 additions and 1 deletions

View File

@ -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.

View File

@ -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;