summary refs log tree commit diff
path: root/libio/wfiledoalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/wfiledoalloc.c')
-rw-r--r--libio/wfiledoalloc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libio/wfiledoalloc.c b/libio/wfiledoalloc.c
index 76226e9846..4e4ca67b2d 100644
--- a/libio/wfiledoalloc.c
+++ b/libio/wfiledoalloc.c
@@ -82,7 +82,7 @@ _IO_wfile_doallocate (fp)
   if (fp->_fileno < 0 || _IO_SYSSTAT (fp, &st) < 0)
     {
       couldbetty = 0;
-      size = _IO_BUFSIZ * sizeof (wchar_t);
+      size = _IO_BUFSIZ;
 #if 0
       /* do not try to optimise fseek() */
       fp->_flags |= __SNPT;
@@ -92,13 +92,12 @@ _IO_wfile_doallocate (fp)
     {
       couldbetty = S_ISCHR (st.st_mode);
 #if _IO_HAVE_ST_BLKSIZE
-      size = ((st.st_blksize <= 0 ? _IO_BUFSIZ : st.st_blksize)
-	      * sizeof (wchar_t));
+      size = st.st_blksize <= 0 ? _IO_BUFSIZ : st.st_blksize;
 #else
-      size = _IO_BUFSIZ * sizeof (wchar_t);
+      size = _IO_BUFSIZ;
 #endif
     }
-  ALLOC_WBUF (p, size, EOF);
+  ALLOC_WBUF (p, size * sizeof (wchar_t), EOF);
   _IO_wsetb (fp, p, p + size, 1);
   if (couldbetty && isatty (fp->_fileno))
     fp->_flags |= _IO_LINE_BUF;