mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 05:58:19 +00:00
assert if str_format
is used with no arguments
This commit is contained in:
parent
8b5da71e89
commit
0664f12265
|
@ -1236,6 +1236,7 @@ int str_format_int(char *buffer, size_t buffer_size, int value);
|
|||
template<typename... Args>
|
||||
int str_format_opt(char *buffer, int buffer_size, const char *format, Args... args)
|
||||
{
|
||||
static_assert(sizeof...(args) > 0, "Use str_copy instead of str_format without format arguments");
|
||||
return str_format(buffer, buffer_size, format, args...);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue