Index: trunk/ab5.0/ablib/src/system/string.sbp
===================================================================
--- trunk/ab5.0/ablib/src/system/string.sbp	(revision 695)
+++ trunk/ab5.0/ablib/src/system/string.sbp	(revision 697)
@@ -23,5 +23,4 @@
 End Function 
 
-
 Function MakeStr(psz As PSTR) As String
 	Return New String(psz)
@@ -38,6 +37,7 @@
 	Function GetWCStr(mbsSrc As PSTR, len As SIZE_T, ByRef wcsDst As PWSTR) As SIZE_T
 		Dim lenWCS = MultiByteToWideChar(CP_ACP, 0, mbsSrc, (len As DWord) As Long, 0, 0)
-		wcsDst = _System_AllocForConvertedString(SizeOf (WCHAR) * lenWCS) As PWSTR
+		wcsDst = _System_AllocForConvertedString(SizeOf (WCHAR) * (lenWCS + 1)) As PWSTR
 		GetWCStr = MultiByteToWideChar(CP_ACP, 0, mbsSrc, (len As DWord) As Long, wcsDst, lenWCS)
+		wcsDst[lenWCS] = 0
 	End Function
 
@@ -49,6 +49,7 @@
 	Function GetMBStr(wcsSrc As PWSTR, len As SIZE_T, ByRef mbsDst As PSTR) As SIZE_T
 		Dim lenMBS = WideCharToMultiByte(CP_ACP, 0, wcsSrc, (len As DWord) As Long, 0, 0, 0, 0)
-		mbsDst = _System_AllocForConvertedString(SizeOf (CHAR) * lenMBS) As PSTR
+		mbsDst = _System_AllocForConvertedString(SizeOf (CHAR) * (lenMBS + 1)) As PSTR
 		GetMBStr = WideCharToMultiByte(CP_ACP, 0, wcsSrc, (len As DWord) As Long, mbsDst, lenMBS, 0, 0) As SIZE_T
+		mbsDst[lenMBS] = 0
 	End Function
 
@@ -80,8 +81,6 @@
 変換の組み合わせは、
 入力引数: wcsz, wcs + len, mbsz, mbs + len, str
-出力関数: wcs(z)出力GetStr, mbs(z)出力GetStr,
-          GetWCStr, GetMBStr, GetTCStr,
-          ToWCStr, ToMBStr, ToTCStr,
-で、5 * 8 = 40通り。
+出力関数: wcs(z)出力GetStr, mbs(z)出力GetStr, ToWCStr, ToMBStr, ToTCStr,
+で、5 * 5 = 25通り。
 */
 
@@ -91,5 +90,5 @@
 		Return 0
 	Else
-		Return Detail.GetWCStr(mbszSrc, (lstrlenA(mbszSrc) + 1) As SIZE_T, wcsDst)
+		Return Detail.GetWCStr(mbszSrc, lstrlenA(mbszSrc) As SIZE_T, wcsDst)
 	End If
 End Function
@@ -129,5 +128,5 @@
 		Return 0
 	Else
-		Return Detail.GetMBStr(wcszSrc, (lstrlenW(wcszSrc) + 1) As SIZE_T, mbsDst)
+		Return Detail.GetMBStr(wcszSrc, lstrlenW(wcszSrc) As SIZE_T, mbsDst)
 	End If
 End Function
@@ -178,64 +177,4 @@
 		Return Detail.GetMBStr(strSrc.StrPtr, strSrc.Length As SIZE_T, mbsDst)
 	End If
-End Function
-
-Function GetWCStr(mbszSrc As PSTR, ByRef wcsDst As PWSTR) As SIZE_T
-	Return GetStr(mbszSrc, wcsDst)
-End Function
-
-Function GetWCStr(mbsSrc As PSTR, len As SIZE_T, ByRef wcsDst As PWSTR) As SIZE_T
-	Return GetStr(mbsSrc, len, wcsDst)
-End Function
-
-Function GetWCStr(wcszSrc As PWSTR, ByRef wcsDst As PWSTR) As SIZE_T
-	Return GetStr(wcszSrc, wcsDst)
-End Function
-
-Function GetWCStr(wcsSrc As PWSTR, len As SIZE_T, ByRef wcsDst As PWSTR) As SIZE_T
-	Return GetStr(wcsSrc, len, wcsDst)
-End Function
-
-Function GetWCStr(strSrc As String, ByRef wcsDst As PWSTR) As SIZE_T
-	Return GetStr(strSrc.StrPtr, strSrc.Length As SIZE_T, wcsDst)
-End Function
-
-Function GetMBStr(mbszSrc As PWSTR, ByRef mbsDst As PSTR) As SIZE_T
-	Return GetStr(mbszSrc, mbsDst)
-End Function
-
-Function GetMBStr(wcsSrc As PWSTR, len As SIZE_T, ByRef mbsDst As PSTR) As SIZE_T
-	Return GetStr(wcsSrc, len, mbsDst)
-End Function
-
-Function GetMBStr(mbszSrc As PSTR, ByRef mbsDst As PSTR) As SIZE_T
-	Return GetStr(mbszSrc, mbsDst)
-End Function
-
-Function GetMBStr(mbsSrc As PSTR, len As SIZE_T, ByRef mbsDst As PSTR) As SIZE_T
-	Return GetStr(mbsSrc, len, mbsDst)
-End Function
-
-Function GetMBStr(strSrc As String, ByRef mbsDst As PSTR) As SIZE_T
-	Return GetStr(strSrc.StrPtr, strSrc.Length As SIZE_T, mbsDst)
-End Function
-
-Function GetTCStr(mbszSrc As PSTR, ByRef tcsDst As PCTSTR) As SIZE_T
-	Return GetStr(mbszSrc, tcsDst)
-End Function
-
-Function GetTCStr(mbsSrc As PSTR, len As SIZE_T, ByRef tcsDst As PCTSTR) As SIZE_T
-	Return GetStr(mbsSrc, len, tcsDst)
-End Function
-
-Function GetTCStr(wcszSrc As PWSTR, ByRef tcsDst As PCTSTR) As SIZE_T
-	Return GetStr(wcszSrc, tcsDst)
-End Function
-
-Function GetTCStr(wcsSrc As PWSTR, len As SIZE_T, ByRef tcsDst As PCTSTR) As SIZE_T
-	Return GetStr(wcsSrc, len, tcsDst)
-End Function
-
-Function GetTCStr(strSrc As String, ByRef tcsDst As PCTSTR) As SIZE_T
-	Return GetStr(strSrc.StrPtr, strSrc.Length As SIZE_T, tcsDst)
 End Function
 
