Go to file
Rich Felker 0440ed69ea fix wide printf continuation after output or encoding errors
this fixes a broader bug for which a special case was reported by
Bruno Haible, in the form of %n getting processed (and reporting the
number of wide characters which would have been written, but weren't)
after an encoding error (EILSEQ). in addition to the %n case, some but
not all of the format specifiers continued to attempt output after an
error. in particular, %c, %lc, and %s all used fputwc directly without
any check for error status.

as long as the error condition was permanent rather than transient,
these write attempts had no visible side effects, but in theory it
could be visible, for example with EAGAIN/EWOULDBLOCK or ENOSPC, if
the condition precluding output came to an end. this could produce
output with missing non-final data, rather than just truncated output,
albeit with the function still returning -1 as expected to report an
error.

to fix this, a check is added to stop processing of any new directive
(including %n) if the stream is already in error state, and direct use
of fputwc is replaced with calls to the out() helper function, which
checks for error status.

note that fprintf is also used directly without checking error status,
but due to how commit d42269d7c8
previously attempted to solve the issue of output after error, the
call to fprintf does not attempt to write anything when the
wide-oriented stream is already in error state. this is non-obvious,
and is quite a hack, so it should be changed, but I've left it alone
for now to make the bug fix commit itself as non-invasive as possible.
2023-03-21 09:10:11 -04:00
arch fix wrong sigaction syscall ABI on mips*, or1k, microblaze, riscv64 2023-02-09 12:33:35 -05:00
compat/time32 remove LFS64 symbol aliases; replace with dynamic linker remapping 2022-10-19 14:01:31 -04:00
crt remove unnecessary and problematic _Noreturn from crt/ldso startup 2019-06-25 19:05:40 -04:00
dist add another example option to dist/config.mak 2012-04-24 16:49:11 -04:00
include fix incorrect unit for CPU_SETSIZE macro 2023-02-23 10:10:44 -05:00
ldso fix debugger tracking of shared libraries on mips with PIE main program 2023-01-18 10:32:14 -05:00
src fix wide printf continuation after output or encoding errors 2023-03-21 09:10:11 -04:00
tools fix incorrect escaping in add-cfi.*.awk scripts 2020-01-20 15:57:29 -05:00
.gitignore remove obsolete gitignore rules 2016-07-06 00:21:25 -04:00
.mailmap update contributor name 2019-12-07 12:21:35 -05:00
configure configure: disable TBAA optimization because most compilers are buggy 2022-10-19 14:01:31 -04:00
COPYRIGHT add optimized aarch64 memcpy and memset 2020-06-26 17:49:51 -04:00
dynamic.list fix regression in access to optopt object 2018-11-19 13:20:41 -05:00
INSTALL fix typo in INSTALL 2020-11-29 00:46:38 -05:00
Makefile make mallocng the default malloc implementation 2020-06-30 15:38:27 -04:00
README update version reference in the README file 2014-06-25 14:16:53 -04:00
VERSION release 1.2.3 2022-04-07 13:12:40 -04:00
WHATSNEW release 1.2.3 2022-04-07 13:12:40 -04:00

    musl libc

musl, pronounced like the word "mussel", is an MIT-licensed
implementation of the standard C library targetting the Linux syscall
API, suitable for use in a wide range of deployment environments. musl
offers efficient static and dynamic linking support, lightweight code
and low runtime overhead, strong fail-safe guarantees under correct
usage, and correctness in the sense of standards conformance and
safety. musl is built on the principle that these goals are best
achieved through simple code that is easy to understand and maintain.

The 1.1 release series for musl features coverage for all interfaces
defined in ISO C99 and POSIX 2008 base, along with a number of
non-standardized interfaces for compatibility with Linux, BSD, and
glibc functionality.

For basic installation instructions, see the included INSTALL file.
Information on full musl-targeted compiler toolchains, system
bootstrapping, and Linux distributions built on musl can be found on
the project website:

    http://www.musl-libc.org/