Changes by: antona
Update of /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30711/ntfsprogs
Modified Files:
utils.c
Log Message:
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)
Index: utils.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/utils.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -p -r1.61 -r1.62
--- utils.c 18 Dec 2005 16:27:21 -0000 1.61
+++ utils.c 27 Mar 2006 22:39:39 -0000 1.62
@@ -211,6 +211,7 @@ ntfs_volume * utils_mount_volume(const c
}
#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,
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;
|