diff options
| author | info@mobile-stream.com | 2019-03-06 16:28:48 +0300 |
|---|---|---|
| committer | sin | 2019-03-07 00:05:34 +0000 |
| commit | 9b796691eb794e9f5279886e917c028a09f8a728 (patch) | |
| tree | 74bba58483d903c2aa83b8c920784d7bb5e2f6ba /include/unistd.h | |
| parent | ff82ffbc74d82091527449e31fe351d15830f716 (diff) | |
wctomb, wcrtomb: guard slow/trap path with MB_LEN_MAX
This allows the compiler to optimize out the slow/trap path at all
for the typical correct code:
char buf[MB_LEN_MAX];
r = wctomb(buf, c);
The change tries to keep the "unknown object size" case handling in
wcrtomb() as is even if it seems redundant and not helping (we copy
__buf to possibly undersized __s in any case) and inconsistent with
wctomb() (where we let the original library method itself overwrite
the possibly undersized __s).
Diffstat (limited to 'include/unistd.h')
0 files changed, 0 insertions, 0 deletions
