Codechange: use string/fmt instead of printf for ShowInfo(F)

This commit is contained in:
Rubidium
2023-04-18 19:41:29 +02:00
committed by rubidium42
parent 8f24901843
commit f5f6306af3
15 changed files with 35 additions and 49 deletions

View File

@@ -161,7 +161,7 @@ void DebugPrint(const char *level, const std::string &message)
* @param s Text describing the wanted debugging levels.
* @param error_func The function to call if a parse error occurs.
*/
void SetDebugString(const char *s, void (*error_func)(const char *))
void SetDebugString(const char *s, void (*error_func)(const std::string &))
{
int v;
char *end;
@@ -207,7 +207,7 @@ void SetDebugString(const char *s, void (*error_func)(const char *))
new_levels[found->name] = v;
} else {
std::string error_string = fmt::format("Unknown debug level '{}'", std::string(t, s - t));
error_func(error_string.c_str());
error_func(error_string);
return;
}
}