FFstrbuf: fix small FFstrbuf allocations in ffStrbufEnsureFree (#1383)

This commit is contained in:
apocelipes
2024-11-10 08:27:57 +08:00
committed by GitHub
parent 0284e4ccc4
commit 7b81ffc8e4
+1 -1
View File
@@ -33,7 +33,7 @@ void ffStrbufEnsureFree(FFstrbuf* strbuf, uint32_t free)
return;
uint32_t allocate = strbuf->allocated;
if(allocate < 2)
if(allocate < FASTFETCH_STRBUF_DEFAULT_ALLOC)
allocate = FASTFETCH_STRBUF_DEFAULT_ALLOC;
while((strbuf->length + free + 1) > allocate) // + 1 for the null byte