diff options
Diffstat (limited to 'main/config.c')
-rw-r--r-- | main/config.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/main/config.c b/main/config.c index 7f7f35558..9d9eefc25 100644 --- a/main/config.c +++ b/main/config.c @@ -2658,6 +2658,13 @@ int ast_parse_arg(const char *arg, enum ast_parse_flags flags, goto int32_done; } error = (x < low) || (x > high); + if (flags & PARSE_RANGE_DEFAULTS) { + if (x < low) { + def = low; + } else if (x > high) { + def = high; + } + } if (flags & PARSE_OUT_RANGE) { error = !error; } @@ -2704,6 +2711,13 @@ int32_done: goto uint32_done; } error = (x < low) || (x > high); + if (flags & PARSE_RANGE_DEFAULTS) { + if (x < low) { + def = low; + } else if (x > high) { + def = high; + } + } if (flags & PARSE_OUT_RANGE) { error = !error; } |