Comment by magicalhippo

Comment by magicalhippo 4 days ago

0 replies

Win32 API at some point started using the convention of having the buffer length be a reference. If the buffer is too small the API function updates the reference with the required buffer length and returns an error code.

I quite like that, within the confines of C. I prefer the caller be responsible for allocations, and this makes it harder to mess up.