summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio
Commit message (Collapse)AuthorAgeFilesLines
* Backout the previous revision due to objections.jb2004-03-092-10/+4
|
* On 4.X it was possible for an application to initialise a local FILEjb2004-03-092-4/+10
| | | | | | | | | structure and call stdio functions. In 5.X this was broken when FILE locking was introduced into libc. This change makes most (relevant) stdio functions work again when the _extra file in FILE isn't initialised (and can't be without a libc function to do it since the __sFILEX structure is private to libc).
* If handed a file pointer we can't write to, set errno properly to EBADFjkh2004-03-021-1/+4
| | | | | | | in order to get SUSv2 conformant behavior in higher level calls like fputs() and puts(). Reviewed by: bde
* Document dependence of mktemp(3) on the non-reentrant arc4random(3).green2004-02-201-0/+7
|
* Merge vfscanf.c,v 1.35.das2004-01-311-4/+10
|
* Fix the handling of negative hexadecimal numbers in integer formats.das2004-01-311-3/+9
| | | | | | | Note that this bug is unrelated to recent work in this area; it seems to have been present since revision 1.1. Obtained from: NetBSD
* Merge vfprintf.c, v1.61 and 1.62. For compatibility with __hdtoa()das2004-01-231-19/+25
| | | | | | | and to reduce diffs between vfprintf.c and vfwprintf.c, declare xdigs* to be char arrays rather than wchar_t arrays. In collaboration with: tjr
* Bring the *printf(3) documentation up to date with the code:das2004-01-191-37/+24
| | | | | | | | | | | | | | | | | | | - Update and improve the documentation for %[aA] o Like %[eE], %[aA] may round the result if a precision is specified. o Grammar police: Fix a split infinitive. o The FreeBSD implementation does better than the minimum required by C99 (literal translation of the mantissa). The digit before the hexadecimal-point is never 0 unless the number itself is 0. o Clarify that the exponent field represents a decimal exponent of 2. o Discuss the fact that multiple valid representations are possible. o Remove the entry in the BUGS section claiming that %[aA] is not implemented. - Remove the entry in the BUGS section claiming that the ' flag for printing thousands separators is unimplemented for floating-point. - Remove the entry in the BUGS section claiming that the L modifier reduces the precision to "double" before conversion.
* Implement __hdtoa() and __hldtoa() and enable printf() support for %adas2004-01-181-5/+2
| | | | and %A, which print floating-point numbers in hexadecimal.
* Prototype __hdtoa() and __hldtoa().das2004-01-181-0/+2
|
* Fix some bugs affecting the %a and %A format specifiers. Sincedas2004-01-181-6/+16
| | | | | | | | | | | | | these are not fully implemented and ifdef'd out, the bugs have never manifested themselves. Specifically: - Fix a memory leak in the case where %a follows another floating-point format. - Make the %a/%A code behave like %e/%E with respect to precision. - It is no longer valid to assume that '-' and '0x' are mutually exclusive. - Address other minor issues.
* Make intentions explicit with additional parenthesis.nectar2004-01-062-8/+8
|
* Remove unused variables and function declarations. Add missing headers.nectar2004-01-061-2/+1
|
* Fix prototype for getchar_unlocked().tjr2003-12-071-1/+1
|
* Use __sfvwrite() instead of __sputc() via __fputwc() to write to faketjr2003-11-121-1/+30
| | | | | | | | string files (__SSTR flag set). This is necessary because __sputc() does not respect the __SALC flag, and crashes trying to flush the buffer instead of resizing it. PR: 59167
* Pass NULL instead of a pointer to a zeroed mbstate_t object.tjr2003-11-056-37/+17
|
* Pass mbrtowc() and wcrtomb() NULL instead of a pointer to a freshly zeroedtjr2003-11-043-9/+3
| | | | | | | mbstate_t object that they ignore. The zeroing is fairly expensive, and it will never be necessary in these functions; when we support state-dependent encodings, we will pass in a pointer to the file's mbstate_t object, and only zero it at the time the file gets opened.
* Fix a typo that caused the optimized single-byte locale path not to be taken.tjr2003-11-011-1/+1
|
* mdoc(7): Use the new feature of the .In macro.ru2003-09-082-3/+3
|
* Add more useful cross-references to the SEE ALSO section.tjr2003-07-051-2/+7
|
* Catch up with recent FP-related changes to scanf.3 and vfwscanf.c.tjr2003-07-051-31/+16
|
* Fix two incorrect uses of sizeof: we need to divide the size of the buffertjr2003-07-051-11/+6
| | | | | | by sizeof(wchar_t) to get the number of wide characters it contains. Remove the !hardway micro-optimisation from the CT_INT case to avoid having to fix it for wide characters.
* Merge recent floating point conversion changes from vfscanf.c.tjr2003-07-051-93/+175
|
* When size is 1 should just null terminate the string. The dummy variablejkh2003-07-021-3/+5
| | | | | | | | | is made an array of two, to explicitly avoid stack corruption due to null-terminating (which is doesn't actually happen due to stack alignment padding). Submitted by: Ed Moy <emoy@apple.com> Obtained from: Apple Computer, Inc.
* Update to reflect changes in vfscanf.c,v 1.32. Remove bogusdas2003-06-281-35/+14
| | | | | | | documentation for %a, and document it correctly instead. s/one of aefg/one of a, e, f, or g/ Reviewed by: standards@
* Revamp scanf's floating-point-parsing algorithm to supportdas2003-06-281-94/+172
| | | | | | | | [+|-]Inf, [+|-]NaN, nan(...), and hexidecimal FP constants. While here, add %a and %A, which are aliases for %e, and add support for long doubles. Reviewed by: standards@
* Add or correct section number in .Xr. Use .Vt or .Fncharnier2003-06-081-1/+1
| | | | instead of .Xr when needed
* Assorted mdoc(7) fixes.ru2003-05-221-1/+1
| | | | Approved by: re (blanket)
* %E-like %g and %G conversions should remove trailing zeroes unlessdas2003-04-192-0/+14
| | | | | | | | the # flag is present. Implement this behavior and add a comment describing it. Noticed by: Enache Adrian <enache@rdslink.ro> Pointy hat to: das
* Merge in vfprintf.c rev. 1.58.tjr2003-04-141-9/+11
|
* Fix a bug where printf was erroneously printing a decimal point fordas2003-04-141-8/+10
| | | | | | | | | %f and sufficiently short %g specifiers where the precision was explicitly zero, no '#' flag was specified, and the floating point argument was > 0 and <= 0.5. While at it, add some comments to better explain the relevant bits of code. Noticed by: Christoph Kukulies <kuku@physik.rwth-aachen.de>
* Catch up with recent vfprintf.c changes.tjr2003-04-071-175/+215
|
* __wcsconv(): free(convbuf) before returning NULLache2003-04-071-2/+4
|
* Today just isn't my day. Remove some old commented out code that snuckdas2003-04-071-1/+1
| | | | | | into the last commit. Noticed by: mike
* - %e conversions with precision 0 should not cause a decimal point todas2003-04-071-18/+22
| | | | | | | | be printed. - Fix %f conversions where the number of significant digits is < expt. This would be a one-line change were it not for thousands separators. Noticed by tjr. - Remove some unnecessary code in the parsing of precision specifiers.
* Rework the floating point code in printf(). Significant changes:das2003-04-052-151/+191
| | | | | | | | | | | | | | | | | | - We used to round long double arguments to double. Now we print them properly. - Bugs involving '%F', corner cases of '#' and 'g' format specifiers, and the '.*' precision specifier have been fixed. - Added support for the "'" specifier to print thousands' grouping characters in a locale-dependent manner. - Implement the __vfprintf() side of hexadecimal floating point support. All that is still needed is a routine to convert the mantissa to hex digits one nibble at a time in the style of ultoa(). Reviewed by: silence on standards@
* Add missing #include to unbreak previous commit.das2003-04-051-0/+1
|
* Correct some buffer sizes.das2003-04-053-23/+42
| | | | | | | | | | - __vfprintf()'s 'buf' has never been used for floating point, so don't define it in terms of (incorrect) constants describing floating point numbers. The actual size needed depends on sizeof(uintmax_t) and locale details, so I slightly overestimated. - We don't need a 308-character buffer to store the string "308". With long doubles and %a we need more than three characters, though.
* Merge vfprintf.c revision 1.52.tjr2003-03-141-2/+2
|
* Kludge around a bug that results from printf() assuming thatdas2003-03-141-1/+1
| | | | | | | | | dtoa() is buggy. The bug would cause incorrect output to be generated when format strings such as '%5.0f' were used with nonzero numbers whose magnitude is less than 1. Reported by: df(1) by way of periodic(8) Reviewed by: mike
* Unexpand RCS tag.tjr2003-03-141-1/+1
|
* MFp4: Catch up to recent __dtoa() interface changes and removal of cvt()'stjr2003-03-131-11/+10
| | | | last argument.
* Replace our ancient dtoa/strtod implementation with the gdtoadas2003-03-121-9/+10
| | | | | | | | | | | | | | | | | | package, a more recent, generalized set of routines. Among the changes: - Declare strtof() and strtold() in stdlib.h. - Add glue to libc to support these routines for all kinds of ``long double''. - Update printf() to reflect the fact that dtoa works slightly differently now. As soon as I see that nothing has blown up, I will kill src/lib/libc/stdlib/strtod.c. Soon printf() will be able to use the new routines to output long doubles without loss of precision, but numerous bugs in the existing code must be addressed first. Reviewed by: bde (briefly), mike (mentor), obrien
* MFp4: Add the standard "the {fgetws,fputws} function will fail if" texttjr2003-03-092-0/+6
| | | | to the Errors section.
* mdoc(7) police: markup laundry.ru2003-02-234-10/+12
|
* Fix the description for mkdtemp(), which creates directories, not files.gshapiro2003-02-191-1/+1
| | | | | Submitted by: Murray S. Kucherawy <msk@blackops.org> X-MFC after: re approval
* Eliminate 61 warnings emitted at WARNS=2 (leaving 53 to go).nectar2003-02-161-2/+2
| | | | | | | Only warnings that could be fixed without changing the generated object code and without restructuring the source code have been handled. Reviewed by: /sbin/md5
* Fix use of an uninitialized pointer introduced in a previous revision.mtm2003-02-061-0/+1
| | | | Approved by: markm (mentor)(implicit)
* Back out previous. Many people disagreed with removing the warning.tjr2003-01-301-0/+8
|
* Remove runtime warning about gets().tjr2003-01-301-8/+0
|
OpenPOWER on IntegriCloud