'robustness' Category
-
Oct142009
Calling legacy code with unknown output buffer size requirements
Ever seen such a function in a C API?
1int describe_something(const something_t *thing, char *buf);
The documentation states that the function will write a description of thing into the given string buffer. Err, sure, but how big do I need to allocate buf? If you are lucky, there docs remark that a buffer size of MAX_PATH should [...]