From: Rich Felker Date: Tue, 1 Jul 2014 22:49:54 +0000 (-0400) Subject: fix incorrect return value for fwide function X-Git-Tag: v1.1.4~67 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ebd8142a6ae19db1a5440d11c01afc7529eae0cd;p=oweals%2Fmusl.git 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. --- 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; }