mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:14:37 +02:00
FFstrbuf: don't crash with ffStrbufInitStatic(&buf, NULL)
This commit is contained in:
@@ -223,6 +223,8 @@ FF_C_NODISCARD static inline FFstrbuf ffStrbufCreate()
|
||||
static inline void ffStrbufInitStatic(FFstrbuf* strbuf, const char* str)
|
||||
{
|
||||
ffStrbufInit(strbuf);
|
||||
if (!str) return;
|
||||
|
||||
strbuf->allocated = 0;
|
||||
strbuf->length = (uint32_t) strlen(str);
|
||||
strbuf->chars = (char*) str;
|
||||
|
||||
Reference in New Issue
Block a user