Index: /Include/system/string.sbp
===================================================================
--- /Include/system/string.sbp	(revision 148)
+++ /Include/system/string.sbp	(revision 149)
@@ -40,6 +40,6 @@
 	Dim sizeWCS = MultiByteToWideChar(CP_THREAD_ACP, 0, psz, len, 0, 0)
 	wcs = _System_AllocForConvertedString(SizeOf (WCHAR) * sizeWCS) As PWSTR
-	GetWCStr = MultiByteToWideChar(CP_THREAD_ACP, 0, psz, len, wcs, sizeWCS)
-	wcs[GetWCStr] = 0
+	GetStr = MultiByteToWideChar(CP_THREAD_ACP, 0, psz, len, wcs, sizeWCS)
+	wcs[GetStr] = 0
 End Function
 
@@ -56,5 +56,5 @@
 	wcs = psz
 	If psz <> 0 Then
-		Return lstrlenW(psz)
+		Return len
 	Else
 		Return 0
@@ -89,5 +89,9 @@
 Function GetStr(psz As PSTR, len As SIZE_T, ByRef mbs As PSTR) As SIZE_T
 	mbs = psz
-	Return len
+	If psz <> 0 Then
+		Return len
+	Else
+		Return 0
+	End If
 End Function
 
@@ -157,5 +161,5 @@
 
 Function GetTCStr(ByRef s As String, ByRef wcs As PCTSTR) As SIZE_T
-	Return GetStr(s.Chars, s.Length, tcs)
+	Return GetStr(s.Chars, s.Length As SIZE_T, tcs)
 End Function
 
@@ -177,85 +181,85 @@
 
 Function GetSCStr(ByRef s As String, ByRef wcs As *StrChar) As SIZE_T
-	Return GetStr(s.Chars, s.Length, ss)
+	Return GetStr(s.Chars, s.Length As SIZE_T, ss)
 End Function
 
 Function ToWCStr(psz As PSTR) As PWSTR
-	Return GetStr(psz, ToWCStr)
+	GetStr(psz, ToWCStr)
 End Function
 
 Function ToWCStr(psz As PSTR, len As SIZE_T) As PWSTR
-	Return GetStr(psz, len, ToWCStr)
+	GetStr(psz, len, ToWCStr)
 End Function
 
 Function ToWCStr(psz As PWSTR) As PWSTR
-	Return GetStr(psz, ToWCStr)
+	GetStr(psz, ToWCStr)
 End Function
 
 Function ToWCStr(psz As PWSTR, len As SIZE_T) As PWSTR
-	Return GetStr(psz, len, ToWCStr)
+	GetStr(psz, len, ToWCStr)
 End Function
 
 Function ToWCStr(ByRef s As String) As PWSTR
-	Return GetStr(s.Chars, s.Length, ToWCStr)
+	GetStr(s.Chars As PWSTR, s.Length As SIZE_T, ToWCStr)
 End Function
 
 Function ToMBStr(psz As PSTR) As PSTR
-	Return GetStr(psz, ToMBStr)
+	GetStr(psz, ToMBStr)
 End Function
 
 Function ToMBStr(psz As PSTR, len As SIZE_T) As PSTR
-	Return GetStr(psz, len, ToMBStr)
+	GetStr(psz, len, ToMBStr)
 End Function
 
 Function ToMBStr(psz As PWSTR) As PSTR
-	Return GetStr(psz, ToMBStr)
+	GetStr(psz, ToMBStr)
 End Function
 
 Function ToMBStr(psz As PWSTR, len As SIZE_T) As PSTR
-	Return GetStr(psz, len, ToMBStr)
+	GetStr(psz, len, ToMBStr)
 End Function
 
 Function ToMBStr(ByRef s As String) As PSTR
-	Return GetStr(s.Chars, s.Length, ToMBStr)
+	GetStr(s.Chars, s.Length As SIZE_T, ToMBStr)
 End Function
 
 Function ToTCStr(psz As PSTR) As PCTSTR
-	Return GetStr(psz, ToTCStr)
+	GetStr(psz, ToTCStr)
 End Function
 
 Function ToTCStr(psz As PSTR, len As SIZE_T) As PCTSTR
-	Return GetStr(psz, len, ToTCStr)
+	GetStr(psz, len, ToTCStr)
 End Function
 
 Function ToTCStr(psz As PWSTR) As PCTSTR
-	Return GetStr(psz, ToTCStr)
+	GetStr(psz, ToTCStr)
 End Function
 
 Function ToTCStr(psz As PWSTR, len As SIZE_T) As PCTSTR
-	Return GetStr(psz, len, ToTCStr)
+	GetStr(psz, len, ToTCStr)
 End Function
 
 Function ToTCStr(ByRef s As String) As PCTSTR
-	Return GetStr(s.Chars, s.Length, ToTCStr)
+	GetStr(s.Chars, s.Length As SIZE_T, ToTCStr)
 End Function
 
 Function ToSCStr(psz As PSTR) As *StrChar
-	Return GetStr(psz, ToSCStr)
+	GetStr(psz, ToSCStr)
 End Function
 
 Function ToSCStr(psz As PSTR, len As SIZE_T) As *StrChar
-	Return GetStr(psz, len, ToSCStr)
+	GetStr(psz, len, ToSCStr)
 End Function
 
 Function ToSCStr(psz As PWSTR) As *StrChar
-	Return GetStr(psz, ToSCStr)
+	GetStr(psz, ToSCStr)
 End Function
 
 Function ToSCStr(psz As PWSTR, len As SIZE_T) As *StrChar
-	Return GetStr(psz, len, ToSCStr)
+	GetStr(psz, len, ToSCStr)
 End Function
 
 Function ToSCStr(ByRef s As String) As *StrChar
-	Return GetStr(s.Chars, s.Length, ToSCStr)
+	GetStr(s.Chars, s.Length As SIZE_T, ToSCStr)
 End Function
 
