summaryrefslogtreecommitdiffstats
path: root/StdLib/LibC/Locale/multibyte_Utf8.c
diff options
context:
space:
mode:
Diffstat (limited to 'StdLib/LibC/Locale/multibyte_Utf8.c')
-rw-r--r--StdLib/LibC/Locale/multibyte_Utf8.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/StdLib/LibC/Locale/multibyte_Utf8.c b/StdLib/LibC/Locale/multibyte_Utf8.c
index 36e2cb379e..ec9b012658 100644
--- a/StdLib/LibC/Locale/multibyte_Utf8.c
+++ b/StdLib/LibC/Locale/multibyte_Utf8.c
@@ -14,6 +14,7 @@
#include <stdlib.h>
#include <wchar.h>
#include <sys/types.h>
+#include <limits.h>
typedef int ch_UCS4;
@@ -913,6 +914,9 @@ wcsrtombs(
return (0);
if (Dest == NULL) {
+ if(MaxBytes <= 0) {
+ MaxBytes = ASCII_STRING_MAX;
+ }
NumStored = EstimateWtoM(*Src, MaxBytes, NULL);
}
else {