summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio
Commit message (Collapse)AuthorAgeFilesLines
* Rework previous commit.. I was confused by the number of diffs in the PRpeter1997-07-061-8/+29
| | | | | | | | | | | | | | | | | and forgot what I was trying to do originally and accidently zapped a feature. :-] The problem is that we are converting a counted buffer in a malloc pool into a null terminated C-style string. I was calling realloc originally to shrink the buffer to the desired size. If realloc failed, we still returned the valid buffer - the only thing wrong was it was a tad too large. The previous commit disabled this. This commit now handles the three cases.. 1: the buffer is exactly right for the null byte to terminate the string (we don't call realloc). 2: it's got h.left = 0, so we must expand it to make room. If realloc fails here, it's fatal. 3: if there's too much room, we realloc to shrink it - a failed realloc is not fatal, we use the original buffer which is still valid.
* Fix off-by-one errorpeter1997-07-061-4/+6
| | | | | PR: 3451 Submitted by: Tim Vanderhoek <ac199@hwcn.org>
* Add 64 bit int support to scanf()jkh1997-07-012-14/+32
| | | | | PR: 2080 Submitted by: David Dawes <dawes@rf900.physics.usyd.edu.au>
* Changed all paths to be relative to src/lib instead of src/lib/libcjb1997-05-031-2/+5
| | | | | | | | | | so that all these makefiles can be used to build libc_r too. Added .if ${LIB} == "c" tests to restrict man page builds to libc to avoid needlessly building them with libc_r too. Split libc Makefile into Makefile and Makefile.inc to allow the libc_r Makefile to include Makefile.inc too.
* Fixed #include and/or prototype bugs in synopsis.bde1997-04-134-6/+6
|
* Fix raceguido1997-04-071-2/+2
| | | | Obtained from: Keith Bostic
* Eliminate yet one function call when locale not usedache1997-04-041-3/+4
|
* Speedup in case locale not usedache1997-04-041-7/+16
|
* The w+ entry description was misformatted.mpp1997-03-271-1/+1
| | | | Pointed out by: bde
* FIxed arg types (mostly missing consts) in synopsis.bde1997-03-191-1/+1
|
* Merge from Lite2peter1997-03-111-2/+2
|
* This commit was generated by cvs2svn to compensate for changes in r23658,peter1997-03-111-17/+17
|\ | | | | | | which included commits to RCS files with non-trunk default branches.
| * Import CSRG 4.4BSD-Lite2 lib/libc onto vendor branchpeter1997-03-112-19/+19
| |
* | Fixed handling of input failure by the scanf family.bde1997-03-031-3/+11
| | | | | | | | | | | | | | | | | | | | | | - 0 was returned instead of EOF when an input failure occured while skipping white-space after 0 assignments. This fixes PR2606. The diagnosis in PR2606 is wrong. - EOF was returned instead of 0 when an input failure occurred after zero assignments and nonzero suppressed assignments. - EOF was spelled -1. This should be in 2.2.
* | Revert $FreeBSD$ to $Id$peter1997-02-2258-58/+58
| |
* | Add XXX comment describing potential memset non-portable issueache1997-02-051-0/+3
| | | | | | | | Nitpicked-by: joerg
* | Sort cross references.wosch1997-01-207-12/+12
| |
* | Use collate for national [a-z]-like rangesache1997-01-161-8/+13
| | | | | | | | Should go in 2.2
* | The following patch to lib/libc/stdio implements positional arguments injkh1997-01-142-22/+414
| | | | | | | | | | | | | | | | | | a manner consistent with other implementations. Its done in a way that adds only a tiny amount of overhead when positional arguments are not used. I also have a test program to go with this, but don't know where it belongs in the tree. Submitted-By: Bill Fenner <fenner@FreeBSD.ORG>
* | Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-1458-58/+58
| | | | | | | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* | perror () does not prepend ": " for the non-NULL argument "". close PR 1492wosch1996-09-301-1/+1
| | | | | | | | | | | | | | Submitted by: Kent Vander Velden <graphix@iastate.edu> Reviewed by: Submitted by: Obtained from:
* | .DV -> .Dv (FOPEN_MAX was invisible).bde1996-09-281-1/+1
| |
* | fwopen() argument type mis-describedpst1996-09-131-1/+1
| | | | | | | | Obtained from: NetBSD lib/2751 (der Mouse)
* | Correctly use .Fn instead of .Nm to reference function namesmpp1996-08-222-2/+4
| | | | | | | | | | | | | | | | in a bunch of man pages. Use the correct .Bx (BSD UNIX) or .At (AT&T UNIX) macros instead of explicitly specifying the version in the text in a bunch of man pages.
* | Update some more man pages to use the .Fx macro.mpp1996-08-211-1/+1
| |
* | Fix nasty bracketing/precedence bug. Every time something read (andpeter1996-08-131-2/+2
| | | | | | | | | | | | | | | | | | refilled) a file that was either line- or un-buffered, all files were flushed. According to the code comment, the flush (according to ANSI) is supposed to happen on write + line buffered output files, not _all_ files. Obtained from: OpenBSD / Theo de Raadt, possibly from proven@cygnus.com
* | Correct the paramter type of the second argument to fgets.mpp1996-08-061-1/+1
| | | | | | | | Obtained from: NetBSD-bugs mailing list
* | Fix some of the problems that bde pointed out to me some time ago.peter1996-07-281-7/+16
| | | | | | | | | | | | - buffer expansions were not working right due to a return code botch. - signed types instead of size_t's meant somebody else went and put casts in, I've changed the types to what they should have been.
* | Suggested by: Bruce Evans, Jeffrey Hsu, Gary Palmerjraynard1996-06-2257-50/+317
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added $Id$'s to files that were lacking them (gpalmer), made some cosmetic changes to conform to style guidelines (bde) and checked against NetBSD and Lite2 to remove unnecessary divergences (hsu, bde) One last code cleanup:- Removed spurious casts in fseek.c and stdio.c. Added missing function argument in fwalk.c. Added missing header include in flags.c and rget.c. Put in casts where int's were being passed as size_t's. Put in missing prototypes for static functions. Changed second args of __sflags() inflags.c and writehook() in vasprintf.c from char * to const char * to conform to prototypes. This directory now compiles with no warnings with -Wall under gcc-2.6.3 and with considerably less warnings than before with the ultra-pedantic script I used for testing. (Most of the remaining ones are due to const poisoning).
* | Code cleanup:-jraynard1996-06-122-2/+3
| | | | | | | | | | The usual stuff, adding missing function prototypes, argument types, return values, etc.
* | Code cleanup:-jraynard1996-06-126-13/+13
| | | | | | | | | | | | | | The usual stuff, adding missing function prototypes, argument types, return values, etc. This directory now compiles with no warnings with -Wall on gcc2.6.3!
* | Code cleanup:-jraynard1996-06-127-12/+11
| | | | | | | | | | | | The usual stuff, adding missing function prototypes, argument types, return values, etc. In mktemp.c, convert pid from u_int to pid_t, and get rid of "extern int errno".
* | Code cleanup:-jraynard1996-06-125-5/+5
| | | | | | | | | | The usual stuff, adding missing function prototypes, argument types, return values, etc.
* | Reword the sentence about the required space for the result string.joerg1996-06-091-1/+1
| | | | | | | | Closes PR # 1303.-
* | Fix bogus MLINKS line from vasprintf change.jkh1996-05-291-2/+2
| |
* | add manpage linkswosch1996-05-291-1/+2
| | | | | | | | | | asprintf.3 -> printf.3 vasprintf -> printf.3
* | Add an implementation of the gnu-ish asprintf() and vasprintf(). They arepeter1996-05-274-38/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | not based on gpl'ed code, just prototype and usage. I'm not 100% certain they behave the same while the system is in trouble (eg: malloc() failing) but in those circumstances all bets would be off anyway. These routines work like sprintf() and vsprintf(), except that instead of using a fixed buffer, they allocate memory and return it to the user and it's the user's responsibility to free() it. They have allocate as much memory as they need (and can get), so the size of strings it can deal with is limited only by the amount of memory it can malloc() on your behalf. There are a few gpl'ed programs starting to use this interface, and it's becoming more common with the scares about security risks with sprintf(). I dont like the look of the code that the various programs (including cvs, gdb, libg++, etc) provide if configure can't find it on the system. It should be possible to modify the stdio core code to provide this interface more efficiently, I was more worried about having something that worked and was secure. :-) (I noticed that there was once intended to be a smprintf() routine when our stdio was written for 4.4BSD, but it looks pretty stillborn, and it's intended interface is not clear). Since Linux and gnu libc have this interface, it seemed silly to bring yet another one onto the scene.
* | Fixed various problems: typos, grammer, missing include filesmpp1996-05-232-5/+5
| | | | | | | | | | wrong function type declarations, and wrong argument type declarations.
* | Fix a typo.mpp1996-05-011-1/+1
| |
* | Correct a minor typo. Fixes part of PR#1000.mpp1996-04-091-1/+1
| | | | | | | | Submitted by: Dave Glowacki <dglo@ssec.wisc.edu>
* | Added missing section numbers to a bunch of .Xr macros, ormpp1996-03-274-15/+15
| | | | | | | | | | converted them into .Fn macros where appropriate. Also fixed up some minor formatting problems.
* | Removed now-bogus casts that were to hide the inconsistency between thebde1996-03-271-4/+4
| | | | | | | | | | | | | | nonstandard normal version and the standard threaded version. Removed a bogus L in a constant. fpos_t's aren't longs, and casting to fpos_t would be verbose.
* | Fixed bogus cross references.bde1996-03-272-5/+5
| | | | | | | | Reviewed by: mpp
* | Say what happens to the buffer when fgets() returns NULL.bde1996-03-271-6/+11
| | | | | | | | Fixed bogus cross references and a misordered line.
* | Since n is int now, sanity check must be n <= 0, not simple n == 0ache1996-03-251-1/+1
| |
* | Fix incorrect parameter types.paul1996-03-242-2/+2
| |
* | The 4.4-lite vfprintf counted the %# hex prefix and the sign infenner1996-03-201-8/+6
| | | | | | | | | | | | | | | | the precision; ANSI X3J11 is not crystal clear but certainly says that the precision specifies the number of /digits/, and signs and "0x" aren't really digits. NetBSD already has a similar patch.
* | Added a little NOTES section explaining that passing in a string thatmpp1996-02-151-0/+22
| | | | | | | | | | | | | | | | | | | | resides in read-only memory is going to cause the program to core dump, and this is commmon with older pre-ANSI C programs. (I've scratched my head over this one at 3 in the morning before while trying to port some ancient program) Suggested by: Gary Kline <kline@tera.com>
* | Fix even more spelling errors in some more man pages.mpp1996-01-301-3/+3
| |
* | Reviewed by: julian and (hsu?)julian1996-01-2232-34/+417
| | | | | | | | | | | | Submitted by: John Birrel(L?) changes for threadsafe operations
OpenPOWER on IntegriCloud