diff options
author | Steve Huston <shuston@riverace.com> | 2007-03-09 01:07:44 +0000 |
---|---|---|
committer | Steve Huston <shuston@riverace.com> | 2007-03-09 01:07:44 +0000 |
commit | a61714cf83a43552d74232bec6bf2965868142de (patch) | |
tree | 6553cb506c511a771a9aac20cc6ff91643494aaf /ACE/ace/OS_NS_string.cpp | |
parent | acc13c6e0ae9f31dd5895864c7fe76bbc2a6f2f6 (diff) | |
download | ATCD-a61714cf83a43552d74232bec6bf2965868142de.tar.gz |
ChangeLogTag:Fri Mar 9 00:53:43 UTC 2007 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'ACE/ace/OS_NS_string.cpp')
-rw-r--r-- | ACE/ace/OS_NS_string.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/ACE/ace/OS_NS_string.cpp b/ACE/ace/OS_NS_string.cpp index 0dd7d0880ba..a5f7248fff8 100644 --- a/ACE/ace/OS_NS_string.cpp +++ b/ACE/ace/OS_NS_string.cpp @@ -121,12 +121,17 @@ ACE_OS::strerror (int errnum) errno = 0; char *errmsg; -#if defined (ACE_WIN32) - if (errnum < 0 || errnum >= _sys_nerr) - errno = EINVAL; +#if defined (ACE_HAS_TR24731_2005_CRT) + errmsg = ret_errortext; + ACE_SECURECRTCALL (strerror_s (ret_errortext, sizeof (ret_errortext), errno), + char *, 0, errmsg); + return errmsg; +#elif defined (ACE_WIN32) + if (errnum < 0 || errnum >= _sys_nerr) + errno = EINVAL; #endif /* ACE_WIN32 */ - errmsg = ::strerror (errnum); - + errmsg = ::strerror (errnum); + if (errno == EINVAL || errmsg == 0 || errmsg[0] == 0) { ACE_OS::sprintf (ret_errortext, "Unknown error %d", errnum); @@ -323,7 +328,8 @@ ACE_OS::strsncpy (ACE_WCHAR_T *dst, const ACE_WCHAR_T *src, size_t maxlen) return dst; } -#if !defined (ACE_HAS_REENTRANT_FUNCTIONS) || defined (ACE_LACKS_STRTOK_R) +#if (!defined (ACE_HAS_REENTRANT_FUNCTIONS) || defined (ACE_LACKS_STRTOK_R)) \ + && !defined (ACE_HAS_TR24731_2005_CRT) char * ACE_OS::strtok_r_emulation (char *s, const char *tokens, char **lasts) { |