about summary refs log tree commit diff
path: root/libio/oldfileops.c
diff options
context:
space:
mode:
authorFeng Gao <gfree.wind@gmail.com>2015-07-08 13:40:50 +0530
committerSiddhesh Poyarekar <siddhesh@redhat.com>2015-07-08 13:53:11 +0530
commit2e4250225cf894e11c926007698cea8096a372fb (patch)
treeb9e544e969ae95d13f3ee6ea7c3f6a77427e2e9d /libio/oldfileops.c
parent808696696837b8b8fc858f2e6f8d4e40e26e1308 (diff)
downloadglibc-2e4250225cf894e11c926007698cea8096a372fb.tar.gz
glibc-2e4250225cf894e11c926007698cea8096a372fb.tar.xz
glibc-2e4250225cf894e11c926007698cea8096a372fb.zip
Use "|" instead of "+" when combine the _IO_LINE_BUF and _IO_UNBUFFERED flags
Both of "_IO_UNBUFFERED" and "_IO_LINE_BUF"  are the bit flags, but I
find there are some codes looks like "_IO_LINE_BUF+_IO_UNBUFFERED",
while some codes are "_IO_LINE_BUF|_IO_UNBUFFERED".

I think the former is not good, even though the final result is same.
Diffstat (limited to 'libio/oldfileops.c')
-rw-r--r--libio/oldfileops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libio/oldfileops.c b/libio/oldfileops.c
index 84939e39ff..54789b2349 100644
--- a/libio/oldfileops.c
+++ b/libio/oldfileops.c
@@ -313,7 +313,7 @@ old_do_write (fp, data, to_do)
     fp->_cur_column = _IO_adjust_column (fp->_cur_column - 1, data, count) + 1;
   _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base);
   fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_buf_base;
-  fp->_IO_write_end = ((fp->_flags & (_IO_LINE_BUF+_IO_UNBUFFERED))
+  fp->_IO_write_end = ((fp->_flags & (_IO_LINE_BUF | _IO_UNBUFFERED))
 		       ? fp->_IO_buf_base : fp->_IO_buf_end);
   return count;
 }
@@ -418,7 +418,7 @@ _IO_old_file_overflow (f, ch)
       f->_IO_write_end = f->_IO_buf_end;
       f->_IO_read_base = f->_IO_read_ptr = f->_IO_read_end;
 
-      if (f->_flags & (_IO_LINE_BUF+_IO_UNBUFFERED))
+      if (f->_flags & (_IO_LINE_BUF | _IO_UNBUFFERED))
 	f->_IO_write_end = f->_IO_write_ptr;
       f->_flags |= _IO_CURRENTLY_PUTTING;
     }