Mercurial > projects > dwt-win
comparison dwt/internal/win32/OS.d @ 290:79a066e09568
Fix: make null ptr possible for WCHARzToStr, thanks Enzo Petrelli
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 21 Aug 2008 16:14:13 +0200 |
parents | 240db000bbcd |
children | 9b075603b4fc |
comparison
equal
deleted
inserted
replaced
289:d17d33bea6d0 | 290:79a066e09568 |
---|---|
3709 return WCHARzToStr(cast(wchar*)string, string.length); | 3709 return WCHARzToStr(cast(wchar*)string, string.length); |
3710 } | 3710 } |
3711 | 3711 |
3712 public char[] WCHARzToStr(wchar* pString, int _length = -1) | 3712 public char[] WCHARzToStr(wchar* pString, int _length = -1) |
3713 { | 3713 { |
3714 if( pString is null ){ | |
3715 return null; | |
3716 } | |
3714 // null terminated string pointer | 3717 // null terminated string pointer |
3715 if(_length == -1){ | 3718 if(_length == -1){ |
3716 _length = 0; | 3719 _length = 0; |
3717 while(*(pString + _length)) | 3720 while(*(pString + _length)) |
3718 ++_length; | 3721 ++_length; |