Found a better way to fix the warning from pevious commit

This commit is contained in:
Linus Dierheimer
2021-11-17 12:00:06 +01:00
parent 6c4961aaff
commit 4e818c981a
2 changed files with 1 additions and 10 deletions
+1 -1
View File
@@ -101,7 +101,7 @@ static void setCapacity(FFstrbuf* strbuf, uint32_t capacity)
void ffStrbufEnsureCapacity(FFstrbuf* strbuf, uint32_t capacity)
{
if(strbuf->allocated > capacity)
if(strbuf->allocated > capacity || capacity == 0)
return;
setCapacity(strbuf, capacity + 1); // + 1 for the null byte