summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/asprintf.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* I am retiring my old email address; replace it with my OpenBSD one.millert2019-01-251-2/+2
|
* Use recallocarray() to avoid leaving detritus in memory when resizingderaadt2017-03-171-2/+4
| | | | | | buffers. We don't bother doing this for objects containing pointers, but focus on controllable data. ok millert
* Only reallocate the buffer to fit for medium-size allocations wheremillert2017-03-161-9/+14
| | | | | we expanded the buffer to a single page. The final realloc() can be expensive for large buffers and is not realled needed. OK deraadt@
* Use a macro for the initial length of the buffer instead of 127; OK deraadt@millert2017-03-141-3/+5
|
* Remove NULL-checks before free() and a few related dead assignments.mmcc2015-12-281-5/+3
| | | | ok and valuable input from millert@
* Add framework for resolving (pun intended) libc namespace issues, usingguenther2015-08-311-2/+2
| | | | | | | | | | | | wrapper .h files and asm labels to let internal calls resolve directly and not be overridable or use the PLT. Then, apply that framework to most of the functions in stdio.h, string.h, err.h, and wchar.h. Delete the should-have-been-hidden-all-along _v?(err|warn)[cx]? symbols while here. tests clean on i386, amd64, sparc64, powerpc, and mips64 naming feedback from kettenis@ and millert@ ok kettenis@
* All these files include <stdlib.h>, so do not need to castderaadt2015-08-201-2/+2
| | | | malloc/calloc/realloc* returns.
* Make printf-like and scanf-like functions marked as such in llib-lc.lnmartynas2011-05-301-1/+2
| | | | | | | and llib-lwrap.ln databases; so that the lint features doing format strings checks are enabled by default. Looks good to millert@.
* Fix the handle locking in stdio to use flockfile/funlockfilekurt2009-11-091-2/+2
| | | | | | | | | | | | | internally when and where required. Macros in <stdio.h> are updated to automatically call the underlying functions when the process is threaded to obtain the necessary locking. A private mutex is added to protect __sglue, the internal list of FILE handles, and another to protect the one-time initialization. Some routines in libc that use getc() change to use getc_unlocked() as they're either protected by their own lock or aren't thread-safe routines anyway. committing on behalf of and okay guenther@ now that we have install media space available.
* Back out previous commit, as it caused too much growth for the installguenther2009-10-221-2/+2
| | | | media to fit
* Fix the handle locking in stdio to use flockfile/funlockfileguenther2009-10-211-2/+2
| | | | | | | | | | | | internally when and where required. Macros in <stdio.h> are updated to automatically call the underlying functions when the process is threaded to obtain the necessary locking. A private mutex is added to protect __sglue, the internal list of FILE handles, and another to protect the one-time initialization. Some routines in libc that use getc() change to use getc_unlocked() as they're either protected by their own lock or aren't thread-safe routines anyway. ok kurt@, earlier version tested by sthen@ and jj@
* Remove a few warnings. Those were not apparent thanks to a bug in gcc 2.95.espie2005-10-101-1/+2
| | | | | Patch by Leonardo Chiquitto Filho <leonardo@iken.com.br> Thanks.
* zap remaining rcsid.espie2005-08-081-5/+1
| | | | | | Kill old files that are no longer compiled. okay theo
* Move the va_start()/va_end() pair such that it directly backets the callmillert2005-05-281-5/+4
| | | | | to vfprintf() like the rest of the *printf functions. This is clearer and makes the error case in asprintf() simpler. From Andrey Matveev.
* Change internals of FILE: reuse the unget buffer field to access anespie2005-04-301-2/+5
| | | | | | | | | | | | | | | | extended attribute data structure (pimpl idiom). Idea taken from citrus. Much discussion with deraadt@, otto@, millert@... This is the least disruptive way to extend FILE, since its size can't really change without this being a flag day. So the size doesn't change. Actual additions to the structure will come in separate steps, since this change is nasty enough on its own. Tests by otto@ and others, careful reading of code by otto@ and millert@. This is definitely a major bump, and has been checked to not impact a full ports build.
* make sure the implementation matches the prototype..pat2005-03-311-3/+3
| | | | | | char const * -> const char * ok otto@ deraadt@
* Sync with share/misc/license.template and add missing DARPA creditmillert2003-06-171-9/+9
| | | | where applicable.
* Use an ISC-tyle license for all my code; it is simpler and more permissive.millert2003-06-031-23/+12
|
* We live in an ANSI C world. Remove lots of gratuitous #ifdef __STDC__ cruft.millert2002-02-191-17/+2
|
* make sure that va_start() has matching va_end()deraadt2001-09-051-3/+4
|
* Make sure we free the buffer in all error cases. Do the finalmillert1998-10-161-15/+20
| | | | | realloc(3) to the size of the string, not the size of the buffer allocated for the string (which is a noop). mycroft@netbsd.org
* realloc repairderaadt1998-08-141-4/+6
|
* Remove the advertising clause in my old license, it impedes free usemillert1998-06-211-6/+3
| | | | | of the code as a large number of similar clauses makes it impossible to write an ad for a product using the code...
* Cast pointer in assignmenttholo1998-02-071-3/+3
|
* Based on some FreeBSD changes:millert1998-01-121-2/+3
| | | | | | For *s*printf, set f._file to -1 like the comments in stdio.h say. Use '\0', not 0, where appropriate. Don't error out on size of '0' for v?snprintf().
* Implement asprintf(3) and vasprintf(3) functions similar to themillert1997-11-291-0/+83
ones in the glibc. Some man pages changes from FreeBSD (asprintf.c/vasprintf.c are not based on GNU or FreeBSD code).