From a9d7fc69b6b0ef5ce02af387c8886fd9e56b463e Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Tue, 21 Jan 2014 00:59:03 -0500 Subject: [PATCH] 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" --- e2fsck/profile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2fsck/profile.c b/e2fsck/profile.c index 9cfab37..c4528c8 100644 --- a/e2fsck/profile.c +++ b/e2fsck/profile.c @@ -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) -- 1.8.3.1