14 Commits

Author SHA1 Message Date
uwe
555c77845c Don't use "NULL" to talk about null-terminated strings.
The C standard seems to be inconsistent about dash vs. space.  Old
text uses dash, Annex K uses space.  I'll let wizd(8) to sort that
out.
2017-06-08 15:59:45 +00:00
joerg
9c6b248add Set error indicator on invalid arguments. From Carsten Hey. 2011-07-22 23:12:30 +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
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
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
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
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
roy
d4a3cf6a5a Add implementations for getdelim(3) and getline(3). 2009-07-13 22:19:24 +00:00