]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/LibC/Stdio/makebuf.c
StdLib/LibC/Stdio: fix "missing braces around initializer"
[mirror_edk2.git] / StdLib / LibC / Stdio / makebuf.c
index 4e69be127579cfad9e57566787b48e91589cc9a7..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
@@ -52,7 +52,7 @@
 #include  <assert.h>\r
 #include  <stdio.h>\r
 #include  <stdlib.h>\r
-#include  <sys/EfiSysCall.h>\r
+#include  <unistd.h>\r
 #include  "reentrant.h"\r
 #include  "local.h"\r
 #include  <MainData.h>\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