projects
/
oweals
/
musl.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
fix scanf %c conversion wrongly storing a terminating null byte
[oweals/musl.git]
/
src
/
stdio
/
fwide.c
1
#include "stdio_impl.h"
2
3
#define SH (8*sizeof(int)-1)
4
#define NORMALIZE(x) ((x)>>SH | -((-(x))>>SH))
5
6
int fwide(FILE *f, int mode)
7
{
8
FLOCK(f);
9
if (!f->mode) mode = f->mode = NORMALIZE(mode);
10
FUNLOCK(f);
11
return mode;
12
}