Skip to content

Commit a9d7fc6

Browse files
committed
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" <[email protected]>
1 parent 3c6e91c commit a9d7fc6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

e2fsck/profile.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1545,7 +1545,7 @@ profile_get_integer(profile_t profile, const char *name, const char *subname,
15451545
/* Empty string is no good. */
15461546
return PROF_BAD_INTEGER;
15471547
errno = 0;
1548-
ret_long = strtol (value, &end_value, 10);
1548+
ret_long = strtol(value, &end_value, 0);
15491549

15501550
/* Overflow or underflow. */
15511551
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,
15871587
/* Empty string is no good. */
15881588
return PROF_BAD_INTEGER;
15891589
errno = 0;
1590-
ret_long = strtoul (value, &end_value, 10);
1590+
ret_long = strtoul(value, &end_value, 0);
15911591

15921592
/* Overflow or underflow. */
15931593
if ((ret_long == ULONG_MAX) && errno != 0)

0 commit comments

Comments
 (0)