News for hackers. Stuff that matters.
Re:What If I Don't Actually Like My Users? (2008) by stcredzero on Friday June 03, 2016 @12:42PM (#11831395)
To be fair, without knowing what that API does, I could see a situation where it itself doesn't know how long the data would be.

This was to get a message out of the API. At the point one is making the call, it does know how long the message is. (Having already gotten a callback.) It looks like the author forgot to write the function that would return the length, then improvised.

Furthermore, the API probably doesn't want to allocate and buffer the data itself since it could be very long, nor does it want to impose a fixed limit since the application should decide that.

This was probably the case.

There are no comments on this comment yet.