Commit Graph

508 Commits

Author SHA1 Message Date
wiz 779fbbb100 Wording. 2010-04-30 06:54:16 +00:00
jruoho 1ad0e6c25b Put SECURITY CONSIDERATIONS as the last section. 2010-04-30 06:23:56 +00:00
jruoho 2f941c83c7 Fix the mess in the sections; someone went to sleep in the middle of a
sentence...
2010-04-30 06:22:28 +00:00
jruoho b0e9ddf609 They've finally made gets(3) obsolete (in POSIX, at least). 2010-04-30 06:00:14 +00:00
jruoho 1b80a21f09 Add HISTORY. 2010-04-30 05:56:14 +00:00
jruoho 4078f3e9d1 Also tmpnam(3) and tempnam(3) are now obsolete in POSIX. 2010-04-30 04:55:10 +00:00
wiz a917229f2a Improve a sentence. 2010-04-29 07:26:39 +00:00
jruoho 157d0c3eea Add some STANDARDS lingo, mainly to note the functions that have been
removed from POSIX (2008).
2010-04-29 06:54:26 +00:00
joerg 20fc76af98 Fix escape sequences 2010-04-05 21:35:36 +00:00
joerg 727da1104c \\ -> \e 2010-04-05 21:33:54 +00:00
joerg 1c3412fa2f Use .In for header files instead of .Ar Pa and variations. 2010-03-22 19:30:53 +00:00
jruoho 66475d5b9d Break the (too) big lead paragraph into three smaller ones. 2010-03-22 13:15:54 +00:00
jruoho 67dcd1d1f0 Bump date for previous. 2010-03-21 20:38:20 +00:00
jruoho 341372abaa Note inttypes(3) also here. 2010-03-21 20:34:52 +00:00
jruoho 61f4a4ebdc Mention the recommended usage of inttypes(3) when applicable. 2010-03-21 19:55:19 +00:00
joerg 00711901b6 Use a proper char */size_t pair in __sfileext to keep track of the line
buffer for fgetln and fgetwln. Simplifies code by dropping the INT_MAX
related logic. Drop conditionals around FREELB, free(NULL) is valid.
2010-01-11 20:39:29 +00:00
christos b56987f3f3 PR/42466: Yasuoka Masahiko: vsnprintf_ss() causes infinite loop 2009-12-17 15:19:48 +00:00
wiz 6277279df4 Whitespace nit. 2009-12-14 07:29:23 +00:00
dholland 34a411910a whoops, bump date for previous. 2009-12-14 04:40:29 +00:00
dholland cd1a57ae6d Document %ll. Closes PR 42283. 2009-12-14 04:39:29 +00:00
joerg f65504295d Fix markup. 2009-12-09 18:06:08 +00:00
roy c9c21f1ecc Test against SSIZE_MAX as pointed out by enami tsugutomo. 2009-12-07 21:31:43 +00:00
roy 5eba354808 Pass lint. 2009-12-02 11:14:47 +00:00
roy 7cfa046806 Reinstate __getdelim which does no locking.
Callers are now required to FLOCKFILE so they can operate on fp as well.
2009-12-02 09:03:13 +00:00
roy 142091db36 Protect getline. 2009-12-02 08:46:33 +00:00
wiz 9e3ffe49a3 Make HTML-ready, use standard section headers, fix Xr. 2009-12-01 08:15:50 +00:00
roy 3490b83a1f Protect getdelim when used internally. 2009-12-01 00:52:13 +00:00
roy 755657be4b Remove __getdelim and just use getdelim.
fgetstr now works with strings up to SSIZE_MAX as a result, but may
reallocate buffers needlessly just like it used to when the buffer size
exceeds INT_MAX.
fgetstr converts errno EOVERFLOW to EINVAL on getdelim error.
2009-12-01 00:03:53 +00:00
roy ec4d484515 Note that callers should use feof(3) or ferror(3) to distinguish between
EOF or an error.
2009-11-30 23:23:29 +00:00
roy 4cf0472d7d Note that EOF returns -1 when no characters are read.
Add code example.
2009-11-30 22:51:46 +00:00
christos cfbb35ed03 revert some of dsl's changes to make things build on i386; he can undo what
he wants when he comes back.
2009-10-25 20:44:13 +00:00
dsl 5f1a9bea9e Lint is differentially far too picky...
Remove some warnings that only appear on i386 (not on amd64) and that
for some reason best known to others are deemed fatal for i386.
Making this code 'pass lint' does absolutely nothing for its readability (etc).
2009-10-25 17:09:34 +00:00
dsl 0b807be843 Remove a load of pointless casts - one that even lint doesn't bleat about. 2009-10-24 15:20:15 +00:00
dsl 695bc79994 Check for EOF before erroring fgets() with length <= 0.
If length is invalid, set errno = EINVAL and __SERR as well returning NULL.
Should let me close PR/41992.
2009-10-24 14:50:48 +00:00
snj 550147bd6a Remove 3rd and 4th clauses in christos' license. OK christos. 2009-10-21 01:07:44 +00:00
dsl 40f437887d Reverse previous, committed by mistake. 2009-10-15 06:19:35 +00:00
roy 5f96926957 Handle errors from getdelim better. 2009-10-15 00:36:24 +00:00
dsl 01a0f8ea84 Change a while () {} into a do {} while() so that fgets(buf, 1, file)
detects EOF on an empty file.
Fixes most of PR/41992
2009-10-14 21:25:52 +00:00
roy 6e80fcc98f Store the allocated buffer against FILE, plugging a memory leak.
Fixes PR bin/42183.
2009-10-14 20:54:51 +00:00
roy 86eafd3e05 __getdelim works on strings up to SIZE_MAX - 2 and returns 0 on EOF.
getdelim works on strings up to SSIZE_MAX and returns -1 on EOF.
__fgetstr is now just a wrapper around __getdelim and ensures that
the buffer doesn't overflow the one provided by FILE.
__slbexpand is now static in fgetwln as it is the only consumer of that func.
2009-09-24 20:38:53 +00:00
wiz 0e46e32aae Note some restrictions for getdelim arguments noted by joerg.
Bump date.
2009-08-25 16:28:26 +00:00
dsl f687cf7e68 If the current locale doesn't define the 'thousands' grouping info
then use sane defaults (',' every 3 digits).
Fixes PR/40714
2009-08-05 20:46:01 +00:00
roy 6c5916565e Allow a buffer of SSIZE_MAX + 1 as the returned bytes do not include the NULL. 2009-07-14 18:29:41 +00:00
christos cfef64a1a4 pass lint 2009-07-14 17:04:32 +00:00
wiz 9400935da7 Fix typo added in previous. 2009-07-13 22:31:59 +00:00
wiz 06601ed792 The character is NUL, the pointer is NULL.
Fix a typo.
It's \-1, not -1.
Add "and getline" in a few places.
Add comma in enumeration.
No dot needed in SEE ALSO.
End sentence with a dot.
2009-07-13 22:30:52 +00:00
roy d4a3cf6a5a Add implementations for getdelim(3) and getline(3). 2009-07-13 22:19:24 +00:00
joerg 58ad7418e8 No .br after .Sh. 2009-04-09 00:04:34 +00:00
joerg fd0a2075ae Fix markup. 2009-03-15 09:26:07 +00:00
christos eb7fe43718 fix sign comparison warning in debug build. 2009-02-21 17:20:01 +00:00
roy dbf72b0e6a printf("%zi\n", (ssize_t)-1); now correcly prints -1 on i386
ok: christos
2009-02-20 09:23:37 +00:00
lukem cfd7bc0451 Fix sign-compare issues.
Ensure provided uio_resid >= 0; negative sizes have "interesting"
semantics elsewhere in stdio, so it's better to avoid them.
2009-02-11 23:48:17 +00:00
lukem 5e1ba2f2e6 sign-compare fix 2009-02-05 03:22:37 +00:00
lukem bc395719cc sign-compare fix 2009-01-31 06:08:28 +00:00
lukem e1e343f9f7 sign-compare fix 2009-01-31 00:08:05 +00:00
lukem 957ba389e8 sign-compare fix 2009-01-30 23:46:03 +00:00
christos 461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
tnozaki 2af58f1cce 1. reworking PR lib/40317:
libnbcompat already contains empty fparseln.lo
so previous fix doesn't work correctly.
i've just added broken fparseln check to configure script.

2. reworking cross build breakage under FreeBSD/MacOS X.
FreeBSD/MacOS X still have public /usr/include/runetype.h
derived from 4.4BSD-Lite.  so i renamed out private header from
src/lib/libc/locale/runetype.h to src/lib/libc/locale/runetype_local.h
to solve this problems.

3. fix build breakage when CITRUS=no was set.
2009-01-05 06:11:43 +00:00
christos a41cd06ba5 PR/9359: Chris Demetriou: Document fread/fwrite mixing behavior. 2008-12-19 20:20:48 +00:00
christos 20ffd1f752 fix return values for snprintf and vsnprintf. 2008-12-16 23:09:19 +00:00
wiz 5d7029bf64 Sort sections, sort SEE ALSO, remove trailing whitespace. 2008-12-11 09:07:46 +00:00
yamt ad61a2c71e move a description of return values into the RETURN VALUES section. 2008-12-11 04:30:57 +00:00
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