]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/LibC/Stdio/makebuf.c
StdLib: Add multi-byte character support. The normal "narrow" character set is now...
[mirror_edk2.git] / StdLib / LibC / Stdio / makebuf.c
index 1b5991489cf513f3646dd41deca7e11adb33d5cb..684f0eebc1c9ea43e9e78bbf7713cef03e5561dd 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
     Implementation of internal file buffer allocation functions.\r
 \r
-    Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
+    Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>\r
     This program and the accompanying materials are licensed and made available\r
     under the terms and conditions of the BSD License that accompanies this\r
     distribution.  The full text of the license may be found at\r
@@ -77,11 +77,12 @@ __smakebuf(FILE *fp)
   if (fp != NULL) {\r
   if (fp->_flags & __SNBF) {\r
     fp->_bf._base = fp->_p = fp->_nbuf;\r
-    fp->_bf._size = 1;\r
+    fp->_bf._size = MB_LEN_MAX;\r
     return;\r
   }\r
   flags = __swhatbuf(fp, &size, &couldbetty);\r
   if ((p = malloc(size)) == NULL) {\r
+    // malloc failed, act unbuffered.\r
     fp->_flags |= __SNBF;\r
     fp->_bf._base = fp->_p = fp->_nbuf;\r
     fp->_bf._size = 1;\r