make size non-optional in add_color

This commit is contained in:
Martin Michelsen
2022-03-31 09:55:25 -07:00
parent 7dce8b6c2c
commit f39dd5a0af
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -416,7 +416,7 @@ void send_text(shared_ptr<Client> c, StringWriter& w, uint16_t command,
string data = encode_sjis(text);
add_color(w, data.c_str(), data.size());
} else {
add_color(w, text);
add_color(w, text, char16len(text));
}
while (w.str().size() & 3) {
w.put_u8(0);
+2 -1
View File
@@ -2,6 +2,7 @@
#include <inttypes.h>
#include <stddef.h>
#include <string.h>
#include <string>
#include <phosg/Encoding.hh>
@@ -110,7 +111,7 @@ size_t add_color_inplace(T* a, size_t max_chars) {
}
template <typename T>
void add_color(StringWriter& w, const T* src, size_t max_input_chars = SIZE_T_MAX) {
void add_color(StringWriter& w, const T* src, size_t max_input_chars) {
for (size_t x = 0; (x < max_input_chars) && *src; x++) {
if (*src == '$') {
w.put<T>('\t');