diff options
author | Rich Felker <dalias@aerifal.cx> | 2014-07-01 18:49:54 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2014-07-01 18:49:54 -0400 |
commit | ebd8142a6ae19db1a5440d11c01afc7529eae0cd (patch) | |
tree | 665eb963963c3c7748729e1240861dbd9ecf933e /src | |
parent | 0b3d33d4d27731f0d80f726fd114c8b9cb3322be (diff) | |
download | musl-ebd8142a6ae19db1a5440d11c01afc7529eae0cd.tar.gz musl-ebd8142a6ae19db1a5440d11c01afc7529eae0cd.tar.xz musl-ebd8142a6ae19db1a5440d11c01afc7529eae0cd.zip |
fix incorrect return value for fwide function
when the orientation of the stream was already set, fwide was incorrectly returning its argument (the requested orientation) rather than the actual orientation of the stream.
Diffstat (limited to 'src')
-rw-r--r-- | src/stdio/fwide.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/stdio/fwide.c b/src/stdio/fwide.c index fdf8e4bb..8088e7ad 100644 --- a/src/stdio/fwide.c +++ b/src/stdio/fwide.c @@ -7,7 +7,8 @@ int fwide(FILE *f, int mode) { FLOCK(f); - if (!f->mode) mode = f->mode = NORMALIZE(mode); + if (!f->mode) f->mode = NORMALIZE(mode); + mode = f->mode; FUNLOCK(f); return mode; } |