e2fsck, mke2fs: enable octal integers in the profile/config file

If an integer in the config file starts with a 0, interpret it as an
octal number.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
maint-test
Theodore Ts'o 2014-01-21 00:59:03 -05:00
parent 3c6e91c549
commit a9d7fc69b6
1 changed files with 2 additions and 2 deletions

View File

@ -1545,7 +1545,7 @@ profile_get_integer(profile_t profile, const char *name, const char *subname,
/* Empty string is no good. */
return PROF_BAD_INTEGER;
errno = 0;
ret_long = strtol (value, &end_value, 10);
ret_long = strtol(value, &end_value, 0);
/* Overflow or underflow. */
if ((ret_long == LONG_MIN || ret_long == LONG_MAX) && errno != 0)
@ -1587,7 +1587,7 @@ profile_get_uint(profile_t profile, const char *name, const char *subname,
/* Empty string is no good. */
return PROF_BAD_INTEGER;
errno = 0;
ret_long = strtoul (value, &end_value, 10);
ret_long = strtoul(value, &end_value, 0);
/* Overflow or underflow. */
if ((ret_long == ULONG_MAX) && errno != 0)