mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-31 11:17:35 +02:00
Check argument index
This commit is contained in:
@ -1626,10 +1626,12 @@ class basic_args {
|
|||||||
uint64_t num_args = -signed_types;
|
uint64_t num_args = -signed_types;
|
||||||
return index < num_args ? args_[index] : format_arg();
|
return index < num_args ? args_[index] : format_arg();
|
||||||
}
|
}
|
||||||
if (index > internal::MAX_PACKED_ARGS)
|
|
||||||
return format_arg();
|
|
||||||
format_arg arg;
|
format_arg arg;
|
||||||
|
if (index > internal::MAX_PACKED_ARGS)
|
||||||
|
return arg;
|
||||||
arg.type_ = type(index);
|
arg.type_ = type(index);
|
||||||
|
if (arg.type_ == internal::NONE)
|
||||||
|
return arg;
|
||||||
internal::value<Context> &val = arg.value_;
|
internal::value<Context> &val = arg.value_;
|
||||||
val = values_[index];
|
val = values_[index];
|
||||||
return arg;
|
return arg;
|
||||||
|
Reference in New Issue
Block a user