summaryrefslogtreecommitdiff
path: root/ace/ace_wchar.inl
diff options
context:
space:
mode:
authorbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-01-16 18:00:06 +0000
committerbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-01-16 18:00:06 +0000
commit24665f303682324d493beba219eff9e52b2d2221 (patch)
tree2850bdb31eed633ab5f5b8987adc8bb0e11611d2 /ace/ace_wchar.inl
parent40ffb140355475ec132101fac16503201517d6ab (diff)
downloadATCD-24665f303682324d493beba219eff9e52b2d2221.tar.gz
ChangeLogTag:Tue Jan 16 09:58:20 2001 Darrell Brunsch <brunsch@uci.edu>
Diffstat (limited to 'ace/ace_wchar.inl')
-rw-r--r--ace/ace_wchar.inl10
1 files changed, 9 insertions, 1 deletions
diff --git a/ace/ace_wchar.inl b/ace/ace_wchar.inl
index 4ee288b9552..e7dedccf081 100644
--- a/ace/ace_wchar.inl
+++ b/ace/ace_wchar.inl
@@ -22,6 +22,10 @@ ACE_Wide_To_Ascii::char_rep (void)
inline char *
ACE_Wide_To_Ascii::convert (const wchar_t *wstr)
{
+ // Short circuit null pointer case
+ if (wstr == 0)
+ return 0;
+
# if defined (ACE_WIN32)
size_t len = ::WideCharToMultiByte (CP_OEMCP,
0,
@@ -32,7 +36,7 @@ ACE_Wide_To_Ascii::convert (const wchar_t *wstr)
NULL,
NULL);
# elif defined (VXWORKS)
- // @@ we should use a different macro than VXWORKS here, ACE_LACKS_WCSLEN?
+ // @todo: we should use a different macro than VXWORKS here, ACE_LACKS_WCSLEN?
const wchar_t *wtemp = wstr;
while (wtemp != 0)
++wtemp;
@@ -82,6 +86,10 @@ ACE_Ascii_To_Wide::wchar_rep (void)
inline wchar_t *
ACE_Ascii_To_Wide::convert (const char *str)
{
+ // Short circuit null pointer case
+ if (str == 0)
+ return 0;
+
# if defined (ACE_WIN32)
size_t len = ::MultiByteToWideChar (CP_OEMCP, 0, str, -1, NULL, 0);
# else /* ACE_WIN32 */