This is very user-unfriendly, and even more so because these codes vary from system to system. Printing the error message would help users determine problems without digging through system headers or posting new topics in the forums.
For unix, there are the standard strerror(), and maybe strerror_r() functions. For Windows there's the winapi FormatMessage?() function (avoid strerror() since it doesn't handle socket codes).
A 'const char* errmsg(int code)' helper function should do the job. Problem is that the system will only provide messages into a prepared buffer, not directly as const*, therefore a static buffer will probably have to be used.
This post has been edited by
Brian
on Jan 25, 2012 4:50
Hercules Elf Bot - Jan 25, 2012 3:44
Originally posted by [b]Gepard[/b] Fixed in [rev=15518].