DynBuf_GrowToFit tries to provide a dynbuf with size greater than the
given size. However, the second argument passed to DynBuf_Enlarge doesn't
match the intention. The size should be directly passed, not the
difference between the target and current size.
static INLINE Bool
#endif
DynBuf_GrowToFit(DynBuf *buf, // IN/OUT
- uint32 size) // IN
+ size_t size) // IN
{
- return buf->allocated >= size ?
- TRUE : DynBuf_Enlarge(buf, size - buf->allocated);
+ return buf->allocated >= size ? TRUE : DynBuf_Enlarge(buf, size);
}
#if defined(__cplusplus)