Codechange: replace text-buf printf with fmt::format

This commit is contained in:
Rubidium
2023-04-19 20:37:21 +02:00
committed by rubidium42
parent 173ed81dbe
commit 3105d0b09e
4 changed files with 6 additions and 20 deletions

View File

@@ -400,21 +400,9 @@ void Textbuf::Assign(StringID string)
* Copy a string into the textbuffer.
* @param text Source.
*/
void Textbuf::Assign(const char *text)
void Textbuf::Assign(const std::string_view text)
{
strecpy(this->buf, text, &this->buf[this->max_bytes - 1]);
this->UpdateSize();
}
/**
* Print a formatted string into the textbuffer.
*/
void Textbuf::Print(const char *format, ...)
{
va_list va;
va_start(va, format);
vseprintf(this->buf, &this->buf[this->max_bytes - 1], format, va);
va_end(va);
strecpy(this->buf, text.data(), &this->buf[this->max_bytes - 1]);
this->UpdateSize();
}