christos
e1e5353bbe
PR/39347: floating and long double conversions were ifdef'ed out because
...
we did not have wcstold and wcstof back then. But this was done incorrectly
because we did not move the argument vector. Enable them now.
2008-11-16 16:26:01 +00:00
christos
9ebdd72925
Nobody tested this? Initialize wcio for wide char i/o.
...
NB: Pullup to 5.0.
2008-11-16 03:16:00 +00:00
apb
debdeec730
The tools/compat versions of mkstemp() and mkdtemp() need to call the
...
internal function that's usually named "__gettemp". However in a cross
build, "__gettemp" is in a namespace reserved for the host system, so we
can't use that. Use "__nbcompat_gettemp" instead, following the example
of several other functions or macros in tools/compat. Previously, this
was handled by using the name "gettemp", but that conflicts with the
local gettemp() function in dist/nawk.
2008-10-20 10:28:38 +00:00
christos
5022bd798d
Ignore whitespace in format string from Andy Shevchenko
2008-08-28 16:41:21 +00:00
aymeric
b0288bde97
fix a "typo" which prevented %ls from working in printf() (NARROW case).
...
Among other things, nvi displays options correctly now.
2008-06-05 19:55:47 +00:00
gdt
f7d5c4db3f
Document the C99-required and already implemented hh modifier (pointer
...
is to a char, vs. h for short). Bump date.
2008-05-30 17:29:54 +00:00
martin
11a6dbe728
Convert TNF licenses to new 2 clause variant
2008-04-30 13:10:46 +00:00
martin
3028e483e4
Convert to new 2 clause license
2008-04-29 06:53:00 +00:00
martin
ce099b4099
Remove clause 3 and 4 from TNF licenses
2008-04-28 20:22:51 +00:00
christos
ab6254493d
Don't coredump on out of memory conditions. This solution leaks, but gdtoa
...
is too complicated to fix. Try printf %99999999999.9999999999f 2
2008-03-21 23:13:48 +00:00
christos
749de7f2a4
Since _file is a short, check that the fd fits in it, otherwise bail with
...
EMFILE. We treat _file as an unsigned short to double our range, with a
special case for -1 (closed). Make a note of what we should do about stdio
if we ever bump libc. We could change _file in the future compatibly to an
int by putting it in the extension space but for now we don't bother.
2008-03-13 15:40:00 +00:00
christos
7d0c83db72
make _FORTIFY_SOURCE play nicely with lint
2007-10-26 19:48:14 +00:00
christos
a9df04f00d
bring in many changes from FreeBSD
2007-06-09 18:51:19 +00:00
christos
1418345039
Make these work with _FORTIFY_SOURCE, by overriding the fortified definitions
2007-06-03 17:39:26 +00:00
christos
28712ce84b
bring in FreeBSD's vfscanf() to gain multi-byte/collation support.
...
Unfortunately it is too difficult to make vfwscanf and this share
the same code like I did with printf, because for string parsing
the code is too different.
2007-04-01 19:23:55 +00:00
tnozaki
a224676694
oops, fix miss-increment fp->_p.
2007-04-01 18:35:53 +00:00
tnozaki
4e9a549847
mbrtowc(3) never return correct multibyte length of L'\0'.
2007-04-01 17:49:10 +00:00
tnozaki
61c3ab2f95
don't use __sgetc() to avoid overwriting fwide(3) orientation
...
(__srget() call by __sgetc() uses _SET_ORIENTATION macro).
2007-04-01 17:11:40 +00:00
drochner
5a8030ba23
modify the previous fix so that no pointless realloc()s are done in
...
the case of multiple empty continuation lines, and comment the code
to make the logics obvious
fix an unrelated comment
2007-03-08 19:57:53 +00:00
drochner
7af4323f9b
-fix a condition so that fparseln() doesn't report spurious empty lines
...
eg after 2 comment lines, or on EOF after a single comment line
-no escape character means no escaped characters
2007-03-07 15:12:01 +00:00
christos
72e430635f
chech the correct fmt in the assertion.
2007-02-03 22:26:55 +00:00
christos
d228a772b3
enable wide doubles.
2007-02-03 00:28:56 +00:00
christos
f38f949967
use vfwprintf.c
2007-02-03 00:28:43 +00:00
christos
093145397b
- merge change from freebsd
...
- add support for building as vfprintf.c
- XXX: we strdup to simplify the freeing logic. This should be fixed for
efficiency in the vfprintf case.
2007-02-03 00:28:33 +00:00
christos
5d7be27437
the buffer len is called slen.
2007-02-03 00:27:52 +00:00
christos
cca9be70a3
protect buffer size from overflow.
2007-02-03 00:23:01 +00:00
christos
aa781c37c2
Instead of abusing stdio to get a signal-safe version of sprintf, provide one.
2007-02-02 23:00:28 +00:00
cbiere
8544bfafc4
Fix for issue reported in PR lib/35401 as well as related overflow bugs.
2007-01-26 00:37:30 +00:00
cbiere
8521e1176a
* Consider all negative return values as error, not just -1.
...
* Corrected cast because (size_t) (INT_MAX + 1) is bogus.
2007-01-26 00:27:54 +00:00
christos
cdcb070b9c
remove bogus (void)&var; From Anon Ymous
2006-12-18 00:40:14 +00:00
christos
1665d5e960
fix spelling of accommodate; from Zapher.
2006-11-24 19:46:58 +00:00
christos
4ca73ce810
Don't expose _ss functions for 4.0. Requested by core.
2006-11-22 17:23:24 +00:00
christos
f45c81bb89
set n properly so that we can terminate.
2006-10-30 05:10:40 +00:00
christos
9984f7540a
fix name in weak alias.
2006-10-29 16:22:17 +00:00
christos
78921a0243
Initialize decimal_point.
2006-10-28 15:02:02 +00:00
christos
f71e448c3b
initialize floating_point as needed.
2006-10-28 14:38:55 +00:00
christos
abca035cf3
Add signal-safe versions of snprintf and vsnprintf
2006-10-27 19:59:58 +00:00
thorpej
2e2d300f43
Grr, adjust last so that it works with our busted lint(1).
2006-10-07 21:40:46 +00:00
thorpej
569c003c39
Use explicit initializers in STDEXT
2006-10-07 20:46:59 +00:00
tnozaki
44eb8f042e
fix gcc -Werror -Wmissing-braces problem
...
mbstate_t(this is opaque object)'s initializer should be ``{ 0 }'',
so changed 1st field of union from character array to integer.
2006-10-04 13:51:59 +00:00
tnozaki
0490c7eba2
fwprintf(stderr) may coredump, when LC_CTYPE locale is set none C/POSIX.
...
make sure to initialize struct __sfileext in FILE.
2006-10-01 10:29:21 +00:00
martin
77d6e4c5bd
As suggested by Johan Veenhuizen in PR 32981, reword slightly to avoid
...
the impression return values would always be -1.
Approved by christos.
2006-09-25 08:55:33 +00:00
jld
04316d3cd7
Remove inappropriate comma.
2006-08-04 20:55:45 +00:00
tnozaki
c98a8494d4
SUSv3 said, if an encoding error occurs, the error indicator
...
for the stream shall be set.
2006-07-03 17:06:36 +00:00
mrg
084c052803
quell GCC 4.1 uninitialised variable warnings.
...
XXX: we should audit the tree for which old ones are no longer needed
after getting the older compilers out of the tree..
2006-05-10 21:53:14 +00:00
wiz
cfed86b6c3
Mark up NULL and -.
2006-03-19 10:46:21 +00:00
rumble
43d45c06c6
Note that for asprintf and vasprintf it is more portable to check for
...
a -1 return, rather than ret being set to NULL on error.
From Otto Moerbeek.
2006-03-18 05:46:04 +00:00
chris
165401a5bd
Move strlen(s) to after s is known to be not NULL, or set to "(null)" .
...
Fixes Coverity CID 2353.
2006-03-17 02:25:23 +00:00
christos
c975cdc86c
- s/notyet/WIDE_DOUBLE/
...
- Add a little more glue for WIDE_DOUBLE; not done yet.
- s/def FLOATING_POINT/ndef NO_FLOATING_POINT/ to reduce diffs with FreeBSD.
- fix memory leak where each double formatted leaked 24 by calling __freedtoa()
appropriately. the new gdtoa keeps a list of memory chunks allocated by
malloc(), and it must maintained properly by calling __freedtoa() on the
results of __dtoa() Hi Klaus!
- in vfwprintf() make cvt return char * and convert it using __mbsconv(),
instead of having it return wchar_t *.
This should fix the memory leaks people have been reporting (eg. in top etc.)
2006-02-16 23:26:19 +00:00
kleink
9cbc15a5b4
Must include "namespace.h" for strerror_r()'s internal name.
2006-01-26 11:13:42 +00:00