diff --git a/include/blah/graphics/batch.h b/include/blah/graphics/batch.h index d475739..2003e95 100644 --- a/include/blah/graphics/batch.h +++ b/include/blah/graphics/batch.h @@ -199,6 +199,8 @@ namespace Blah u8 wash; u8 fill; u8 pad; + + Vertex() = default; }; struct DrawBatch diff --git a/src/containers/str.cpp b/src/containers/str.cpp index 8b30f6a..d4421a7 100644 --- a/src/containers/str.cpp +++ b/src/containers/str.cpp @@ -471,12 +471,22 @@ void Str::set(const char* start, const char* end) if (end == nullptr) end = start + strlen(start); - // reserve - m_length = (int)(end - start); - reserve(m_length); + // make sure it actually contains characters + int len = (int)(end - start); + if (len <= 0) + { + clear(); + } + else + { + m_length = len; + + // reserve + reserve(m_length); - // copy the data over - char* ptr = data(); - memcpy(ptr, start, m_length); - ptr[m_length] = '\0'; + // copy the data over + char* ptr = data(); + memcpy(ptr, start, m_length); + ptr[m_length] = '\0'; + } } \ No newline at end of file