This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] [BZ #12836] Make fmemopen(buf,size,"w+b") binary.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: libc-alpha at sourceware dot org
- Date: Thu, 9 May 2013 18:16:48 +0200
- Subject: [PATCH] [BZ #12836] Make fmemopen(buf,size,"w+b") binary.
Posting Eric Blake patch from
http://sourceware.org/bugzilla/show_bug.cgi?id=12836
OK to commit?
* libio/fmemopen.c (fmemopen) Make mode "w+b" binary.
---
libio/fmemopen.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libio/fmemopen.c b/libio/fmemopen.c
index 02c764f..726ebd1 100644
--- a/libio/fmemopen.c
+++ b/libio/fmemopen.c
@@ -249,7 +249,7 @@ fmemopen (void *buf, size_t len, const char *mode)
else
c->pos = 0;
- c->binmode = mode[0] != '\0' && mode[1] == 'b';
+ c->binmode = mode[0] && mode[1 + (mode[1] == '+')] == 'b';
iof.read = fmemopen_read;
iof.write = fmemopen_write;
--
1.7.4.4