In win32 API there is a function to load a string from the resources. It takes as argument a handle to the module (dll or exe file), a pointer to a buffer, the size of the buffer and the ID number of the string. So far so good. The return value however is described as such:
"If the function succeeds, the return value is the number of TCHARs copied into the buffer, not including the terminating NULL character, or zero if the string resource does not exist."
Now you might imagine that they have an excuse, such as for some technical reason the return type of this function must be unsigned? Nope, it's just an int.