summaryrefslogtreecommitdiff
path: root/sys/src/libstdio
AgeCommit message (Collapse)Author
2023-02-19mkfiles: add 'mk test' supportOri Bernstein
9front has several tests scattered throughout the source, as well as more tests in an external 'regress' repository. Many of these tests are broken, because there is no easy way to build and track all of them. This pulls in several tests from different sources, deletes the broken tests, tests with missing data, and adds a single command that can be run from the root of the src directory to test our system. The hope is that as we develop new code, we add more tests, and eventually start running the tests on every commit. Please enter the commit message for your changes. Lines starting
2021-02-19libstdio: sync bits of vfprintf from APEkvik
* Add the %ll length modifier, * Convert nil to "<nil>" under %s (not in APE), * Cast void* to uintptr under %p, * Use "0x" hex prefix under %p, * Fix manual page mentions of %P to %p, * Fix empty result for fp conversions, * Fix zero padding of left-aligned fp conversions, * Remove deprecated #pragma ref uses. Most of these were introduced in APE prior to 9front. I've omitted the %z conversion specifier since Plan 9 code rarely uses the usize type. This may need to be added later for the benefit of native ports of alien code.
2021-02-09stdio: remove erronous assert in dtoaOri Bernstein
The value of `k` in dtoa() is an estimate of floor(log10(d)), where `d` is the number being converted. The code was asserting that 'k' was less than 100, but the full range of a double goes to 10^308 or so. This means that the majority of the range of a double would trigger that assert.
2020-05-15#pragma ref no longer existsOri Bernstein
It appears to be an antiquated form of 'USED(x)'
2020-05-15Fix scans of more than one character in %[]Ori Bernstein
This got broken in d8e877a89dae, where we returned 0 on the first mismatch; we want to return 0 only when we consumed no characters.
2020-05-09fix '%[]' specifiers and '%n' (thanks phil9)Ori Bernstein
When a match() fails, we need to unget the character we tried to match against, rather than leaving it consumed. Also, we can't break out of a conversion before we reach the end of a format string, because things like the '%n' conversion do not consume anything, and should still be handled.
2016-11-27stdio: fix sclose() buffer overrun when terminating string, realloc() error ↵cinap_lenrek
handling (thanks porlock) theres a bug is in sclose() where it doesnt check if wp is beyond the buffer. also wp was not updated after realloc(). bug was reported by porlock on 9fans: Plan 9's implementation of the standard C functions snprintf and vsnprintf have a buffer overrun bug. If the buffer length equals the output length (without the terminating null), then one too many characters is written to the buffer. For example, snprintf(buf, 4, "ABCD"); will write 5 characters to buf.
2016-11-17/sys/src/lib*: clean upftrvxmtrx
2014-06-12libstdio: avoid issues with aliasing in dtoa() on amd64 (from 9atom, thanks ↵cinap_lenrek
to erik and charles)
2011-03-30Import sources from 2011-03-30 iso image - libTaru Karttunen
2011-03-30Import sources from 2011-03-30 iso imageTaru Karttunen