mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 09:58:17 +00:00
FreeSWITCH: Add WIN32 strerror_s() variant to custom switch_strerror_r() helper function and fix more strerror_r() users.
Convert mod_xml_cdr, mod_json_cdr and mod_conference to the new function. Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
This commit is contained in:
@@ -2985,6 +2985,12 @@ SWITCH_DECLARE(char *) switch_strerror_r(int errnum, char *buf, switch_size_t bu
|
||||
}
|
||||
return buf;
|
||||
#endif /* STRERROR_R_CHAR_P */
|
||||
#elif defined(WIN32)
|
||||
/* WIN32 variant */
|
||||
if (strerror_s(buf, buflen, errnum)) {
|
||||
switch_snprintf(buf, buflen, "Unknown error %d", errnum);
|
||||
}
|
||||
return buf;
|
||||
#else
|
||||
/* Fallback, copy string into private buffer */
|
||||
switch_copy_string(buf, strerror(errnum), buflen);
|
||||
|
Reference in New Issue
Block a user