summaryrefslogtreecommitdiff
path: root/lib/libc/stdio/fgetstr.c
AgeCommit message (Collapse)Author
2017-06-08Don't use "NULL" to talk about null-terminated strings.uwe
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.
2010-01-11Use a proper char */size_t pair in __sfileext to keep track of the linejoerg
buffer for fgetln and fgetwln. Simplifies code by dropping the INT_MAX related logic. Drop conditionals around FREELB, free(NULL) is valid.
2009-12-02Reinstate __getdelim which does no locking.roy
Callers are now required to FLOCKFILE so they can operate on fp as well.
2009-12-01Remove __getdelim and just use getdelim.roy
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-10-15Handle errors from getdelim better.roy
2009-10-14Store the allocated buffer against FILE, plugging a memory leak.roy
Fixes PR bin/42183.
2009-09-24__getdelim works on strings up to SIZE_MAX - 2 and returns 0 on EOF.roy
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-01-31sign-compare fixlukem
2006-11-24fix spelling of accommodate; from Zapher.christos
2005-05-14Add the missing wide char support functions from freebsd.christos
XXX: long double support is missing until we get gdtoa, and add the necessary wide functions.
2004-05-10After discussion with christos, turn fgetstr() into an internal function.drochner
Its API in inherently non-threadsafe (and it depends on certain properties of the underlying stdio implementation), so it shouldn't be a first-class function for general use, polluting the application namespace. Also remove the FLOCKFILE() code from it - this is under control of the calling function now. (XXX I'm not sure whether the FLOCKFILE() should be kept in fgetln(), this function cannot be used in multiple threads anyway. It doesn't hurt much, and it might prevent corruption of internal FILE structures.)
2004-04-21Add a generalized version of fgetln that can stop at an arbitrary delimiter,christos
and implement fgetln on top of that.