Commit Graph

59 Commits

Author SHA1 Message Date
guido
5b77d8f791 Fix race
Obtained from: Keith Bostic
1997-04-07 18:01:10 +00:00
ache
8dc8604567 Eliminate yet one function call when locale not used 1997-04-04 19:07:02 +00:00
ache
3cb787be7f Speedup in case locale not used 1997-04-04 18:28:38 +00:00
mpp
df9784adc5 The w+ entry description was misformatted.
Pointed out by: bde
1997-03-27 18:08:23 +00:00
bde
4cc11f6a3d FIxed arg types (mostly missing consts) in synopsis. 1997-03-19 00:52:58 +00:00
peter
3c7b61789b Merge from Lite2 1997-03-11 11:40:40 +00:00
peter
e8e23405de This commit was generated by cvs2svn to compensate for changes in r23658,
which included commits to RCS files with non-trunk default branches.
1997-03-11 11:29:42 +00:00
peter
e0e06d68d5 Import CSRG 4.4BSD-Lite2 lib/libc onto vendor branch 1997-03-11 11:29:42 +00:00
bde
6c38eceeb9 Fixed handling of input failure by the scanf family.
- 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.
1997-03-03 17:53:02 +00:00
peter
6b08958c64 Revert $FreeBSD$ to $Id$ 1997-02-22 15:12:41 +00:00
ache
3ef0c8c52c Add XXX comment describing potential memset non-portable issue
Nitpicked-by: joerg
1997-02-05 20:54:16 +00:00
wosch
6d0dbd7455 Sort cross references. 1997-01-20 23:23:22 +00:00
ache
f8e72105a5 Use collate for national [a-z]-like ranges
Should go in 2.2
1997-01-16 07:36:14 +00:00
jkh
11432bdb02 The following patch to lib/libc/stdio implements positional arguments in
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>
1997-01-14 07:31:39 +00:00
jkh
808a36ef65 Make the long-awaited change from $Id$ to $FreeBSD$
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.
1997-01-14 07:20:47 +00:00
wosch
df70961c5a perror () does not prepend ": " for the non-NULL argument "". close PR 1492
Submitted by: Kent Vander Velden <graphix@iastate.edu>
Reviewed by:
Submitted by:
Obtained from:
1996-09-30 15:39:18 +00:00
bde
fe6f7878fc .DV -> .Dv (FOPEN_MAX was invisible). 1996-09-28 13:18:12 +00:00
pst
aa0bf1e119 fwopen() argument type mis-described
Obtained from: NetBSD lib/2751 (der Mouse)
1996-09-13 19:14:12 +00:00
mpp
5e0b8a5234 Correctly use .Fn instead of .Nm to reference function names
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.
1996-08-22 23:31:07 +00:00
mpp
e3cbaed955 Update some more man pages to use the .Fx macro. 1996-08-21 22:10:36 +00:00
peter
8542445a70 Fix nasty bracketing/precedence bug. Every time something read (and
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
1996-08-13 17:49:45 +00:00
mpp
e1eb4abb60 Correct the paramter type of the second argument to fgets.
Obtained from: NetBSD-bugs mailing list
1996-08-06 22:34:44 +00:00
peter
5e197e7c26 Fix some of the problems that bde pointed out to me some time ago.
- 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.
1996-07-28 16:16:11 +00:00
jraynard
fac2ce3b12 Suggested by: Bruce Evans, Jeffrey Hsu, Gary Palmer
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).
1996-06-22 10:34:15 +00:00
jraynard
682813b4cd Code cleanup:-
The usual stuff, adding missing function prototypes, argument types,
return values, etc.
1996-06-12 23:02:53 +00:00
jraynard
e85e320a9e Code cleanup:-
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!
1996-06-12 22:59:55 +00:00
jraynard
4a395602dc Code cleanup:-
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".
1996-06-12 22:58:21 +00:00
jraynard
8a4400a463 Code cleanup:-
The usual stuff, adding missing function prototypes, argument types,
return values, etc.
1996-06-12 22:56:41 +00:00
joerg
896e5dbb71 Reword the sentence about the required space for the result string.
Closes PR # 1303.-
1996-06-09 06:48:42 +00:00
jkh
37deb9b657 Fix bogus MLINKS line from vasprintf change. 1996-05-29 05:00:12 +00:00
wosch
55faaca1d9 add manpage links
asprintf.3 -> printf.3
vasprintf -> printf.3
1996-05-29 01:00:00 +00:00
peter
fbe6339187 Add an implementation of the gnu-ish asprintf() and vasprintf(). They are
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.
1996-05-27 10:49:43 +00:00
mpp
ba6f97d58c Fixed various problems: typos, grammer, missing include files
wrong function type declarations, and wrong argument type
declarations.
1996-05-23 01:05:25 +00:00
mpp
e7fdb04c6f Fix a typo. 1996-05-01 22:49:36 +00:00
mpp
a86dce0f60 Correct a minor typo. Fixes part of PR#1000.
Submitted by:	Dave Glowacki <dglo@ssec.wisc.edu>
1996-04-09 21:48:21 +00:00
mpp
822fdcab93 Added missing section numbers to a bunch of .Xr macros, or
converted them into .Fn macros where appropriate.  Also fixed
up some minor formatting problems.
1996-03-27 20:49:07 +00:00
bde
f8f67e13c6 Removed now-bogus casts that were to hide the inconsistency between the
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.
1996-03-27 18:07:29 +00:00
bde
0994461968 Fixed bogus cross references.
Reviewed by:	mpp
1996-03-27 17:54:40 +00:00
bde
f1d0d6d615 Say what happens to the buffer when fgets() returns NULL.
Fixed bogus cross references and a misordered line.
1996-03-27 17:43:38 +00:00
ache
53d0d5e303 Since n is int now, sanity check must be n <= 0, not simple n == 0 1996-03-25 12:03:11 +00:00
paul
a9cb635df2 Fix incorrect parameter types. 1996-03-24 15:49:34 +00:00
fenner
78136570e7 The 4.4-lite vfprintf counted the %# hex prefix and the sign in
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.
1996-03-20 18:28:48 +00:00
mpp
548ad36a13 Added a little NOTES section explaining that passing in a string that
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>
1996-02-15 05:02:16 +00:00
mpp
62cdcaa268 Fix even more spelling errors in some more man pages. 1996-01-30 16:34:52 +00:00
julian
619b731f5b Reviewed by: julian and (hsu?)
Submitted by:	 John Birrel(L?)

changes for threadsafe operations
1996-01-22 00:02:33 +00:00
mpp
95fd971cf1 Fix a variety of minor typos and cross references in a bunch of
man pages.

Masanobu Saitoh <msaitoh@spa.is.uec.ac.jp>
Giles Lean <giles@nemeton.com.au>
<soda@sra.co.jp>
1996-01-20 07:29:11 +00:00
phk
d271416c7b Minor cleanup, #include's and unused vars.
Added compile-time warning to an old funky function.
1995-10-22 14:52:30 +00:00
peter
e5aed16e7a Make a link-time warning for the use of gets().
IMHO, the run-time warning should come out, but I'm not game to start that
fight yet...  This uses a feature of the gnu linker.

Inspired by:  NetBSD
1995-10-04 18:29:01 +00:00
bde
44ef21c573 This gets() used \r\n, which is doggish. 1995-09-29 18:52:47 +00:00
peter
05034fc20d fgetline does not exist.. fgetln is in it's place. Correct the X-Ref.
Noticed by:	Brian Tao, Bruce Evans
1995-08-18 14:22:00 +00:00