Skip to content
Snippets Groups Projects
Commit 0dec21c9 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Change STRERROR() to be just an alias for strerror() on all platforms

Its a terrible idea to modify the return value of strerror() on any platform. strerror() can (and often does) return immutable string constants - don't try to modify that string even if it does end in trailing white-space (find another solution to that). This change only affects non-*nix builds since we were already doing the right thing for *nix.
parent 42ba119c
No related branches found
No related tags found
No related merge requests found
......@@ -272,11 +272,7 @@ DLLEXPORT char* DLLCALL truncsp_lines(char* str);
/* Truncate new-line chars off end of string */
DLLEXPORT char* DLLCALL truncnl(char* str);
#if defined(__unix__)
#define STRERROR(x) strerror(x)
#else
#define STRERROR(x) truncsp(strerror(x))
#endif
#define STRERROR(x) strerror(x)
/* Re-entrant version of strerror() */
DLLEXPORT char* DLLCALL safe_strerror(int errnum, char* buf, size_t buflen);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment