Nul termination is done via '\0' or L'\0'. Not via '0' or L'0'.
---
mingw-w64-crt/misc/mingw_mbwc_convert.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mingw-w64-crt/misc/mingw_mbwc_convert.c
b/mingw-w64-crt/misc/mingw_mbwc_convert.c
index 26e876fdcf2d..dc00589b3322 100644
--- a/mingw-w64-crt/misc/mingw_mbwc_convert.c
+++ b/mingw-w64-crt/misc/mingw_mbwc_convert.c
@@ -16,7 +16,7 @@ int __cdecl __mingw_str_wide_utf8(const wchar_t * const wptr,
char **mbptr, size
if(!buf) len = 0;
else {
if (len != 0) ret = WideCharToMultiByte(CP_UTF8, 0, wptr, -1, buf, len,
NULL, NULL); /*Do actual conversion*/
- buf[len] = '0'; /* Must terminate */
+ buf[len] = '\0'; /* Must terminate */
}
*mbptr = buf; /* Set string pointer to allocated buffer */
if(buflen != NULL) *buflen = (len) * sizeof (char); /* Give length of
allocated memory if needed. */
@@ -35,7 +35,7 @@ int __cdecl __mingw_str_utf8_wide(const char *const mbptr,
wchar_t **wptr, size_
if(!buf) len = 0;
else {
if (len != 0) ret = MultiByteToWideChar (CP_UTF8, MB_ERR_INVALID_CHARS,
mbptr, -1, buf, len); /* Do conversion */
- buf[len] = L'0'; /* Must terminate */
+ buf[len] = L'\0'; /* Must terminate */
}
*wptr = buf; /* Set string pointer to allocated buffer */
if (buflen != NULL) *buflen = len * sizeof (wchar_t); /* Give length of
allocated memory if needed. */
--
2.20.1
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public