<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libc/stdio/vasprintf.c, branch release/4.6.1</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>$Id$ -&gt; $FreeBSD$</title>
<updated>1999-08-28T00:22:10+00:00</updated>
<author>
<name>Peter Wemm</name>
<email>peter@FreeBSD.org</email>
</author>
<published>1999-08-28T00:22:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=7f3dea244c40159a41ab22da77a434d7c5b5e85a'/>
<id>7f3dea244c40159a41ab22da77a434d7c5b5e85a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Replace memory leaking instances of realloc with non-leaking reallocf.</title>
<updated>1998-09-16T04:17:47+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>1998-09-16T04:17:47+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=e8420087b0ae4a2d0611cd2f6413d150cfc83554'/>
<id>e8420087b0ae4a2d0611cd2f6413d150cfc83554</id>
<content type='text'>
In some cases replace if (a == null) a = malloc(x); else a =
realloc(a, x); with simple reallocf(a, x).  Per ANSI-C, this is
guaranteed to be the same thing.

I've been running these on my system here w/o ill effects for some
time.  However, the CTM-express is at part 6 of 34 for the CAM
changes, so I've not been able to do a build world with the CAM in the
tree with these changes.  Shouldn't impact anything, but...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In some cases replace if (a == null) a = malloc(x); else a =
realloc(a, x); with simple reallocf(a, x).  Per ANSI-C, this is
guaranteed to be the same thing.

I've been running these on my system here w/o ill effects for some
time.  However, the CTM-express is at part 6 of 34 for the CAM
changes, so I've not been able to do a build world with the CAM in the
tree with these changes.  Shouldn't impact anything, but...
</pre>
</div>
</content>
</entry>
<entry>
<title>Replace my original asprintf() and vasprintf() hacks with something</title>
<updated>1998-07-08T00:44:56+00:00</updated>
<author>
<name>Peter Wemm</name>
<email>peter@FreeBSD.org</email>
</author>
<published>1998-07-08T00:44:56+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=64a965e7078acf9079cbe7f2c001852d4f6f2832'/>
<id>64a965e7078acf9079cbe7f2c001852d4f6f2832</id>
<content type='text'>
more cleanly integrated with stdio.  This should be faster and cleaner
since it doesn't memcpy() the data into a seperate buffer.  This lets
stdio allocate and manage the buffer and then hand it over to the user.

Obtained from: Todd Miller &lt;Todd.Miller@courtesan.com&gt; via OpenBSD
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
more cleanly integrated with stdio.  This should be faster and cleaner
since it doesn't memcpy() the data into a seperate buffer.  This lets
stdio allocate and manage the buffer and then hand it over to the user.

Obtained from: Todd Miller &lt;Todd.Miller@courtesan.com&gt; via OpenBSD
</pre>
</div>
</content>
</entry>
<entry>
<title>Added #include &lt;string.h&gt; to get prototypes.</title>
<updated>1998-03-09T06:51:23+00:00</updated>
<author>
<name>John Birrell</name>
<email>jb@FreeBSD.org</email>
</author>
<published>1998-03-09T06:51:23+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=e7b6782c39ecc02fbfc5545df7fdc0a43c82297e'/>
<id>e7b6782c39ecc02fbfc5545df7fdc0a43c82297e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Rework previous commit..  I was confused by the number of diffs in the PR</title>
<updated>1997-07-06T08:42:37+00:00</updated>
<author>
<name>Peter Wemm</name>
<email>peter@FreeBSD.org</email>
</author>
<published>1997-07-06T08:42:37+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=e48f3cfbfc83b4d0c4fa376c316a3da03d867722'/>
<id>e48f3cfbfc83b4d0c4fa376c316a3da03d867722</id>
<content type='text'>
and forgot what I was trying to do originally and accidently zapped
a feature. :-]  The problem is that we are converting a counted buffer in
a malloc pool into a null terminated C-style string.  I was calling realloc
originally to shrink the buffer to the desired size.  If realloc failed, we
still returned the valid buffer - the only thing wrong was it was a tad
too large.  The previous commit disabled this.

This commit now handles the three cases..
1: the buffer is exactly right for the null byte to terminate the
string (we don't call realloc).
2: it's got h.left = 0, so we must expand it to make room. If realloc
fails here, it's fatal.
3: if there's too much room, we realloc to shrink it - a failed realloc
is not fatal, we use the original buffer which is still valid.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
and forgot what I was trying to do originally and accidently zapped
a feature. :-]  The problem is that we are converting a counted buffer in
a malloc pool into a null terminated C-style string.  I was calling realloc
originally to shrink the buffer to the desired size.  If realloc failed, we
still returned the valid buffer - the only thing wrong was it was a tad
too large.  The previous commit disabled this.

This commit now handles the three cases..
1: the buffer is exactly right for the null byte to terminate the
string (we don't call realloc).
2: it's got h.left = 0, so we must expand it to make room. If realloc
fails here, it's fatal.
3: if there's too much room, we realloc to shrink it - a failed realloc
is not fatal, we use the original buffer which is still valid.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix off-by-one error</title>
<updated>1997-07-06T07:54:56+00:00</updated>
<author>
<name>Peter Wemm</name>
<email>peter@FreeBSD.org</email>
</author>
<published>1997-07-06T07:54:56+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=3c55a3f2434cacc42ff958865db546973d8c6427'/>
<id>3c55a3f2434cacc42ff958865db546973d8c6427</id>
<content type='text'>
PR: 3451
Submitted by: Tim Vanderhoek &lt;ac199@hwcn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PR: 3451
Submitted by: Tim Vanderhoek &lt;ac199@hwcn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert $FreeBSD$ to $Id$</title>
<updated>1997-02-22T15:12:41+00:00</updated>
<author>
<name>Peter Wemm</name>
<email>peter@FreeBSD.org</email>
</author>
<published>1997-02-22T15:12:41+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=7e546392b5fe3a496acff53ac7aadd1c57b2a4cf'/>
<id>7e546392b5fe3a496acff53ac7aadd1c57b2a4cf</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Make the long-awaited change from $Id$ to $FreeBSD$</title>
<updated>1997-01-14T07:20:47+00:00</updated>
<author>
<name>Jordan K. Hubbard</name>
<email>jkh@FreeBSD.org</email>
</author>
<published>1997-01-14T07:20:47+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=1130b656e5fe4c2d1ba299e024d1b40eaeebd380'/>
<id>1130b656e5fe4c2d1ba299e024d1b40eaeebd380</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix some of the problems that bde pointed out to me some time ago.</title>
<updated>1996-07-28T16:16:11+00:00</updated>
<author>
<name>Peter Wemm</name>
<email>peter@FreeBSD.org</email>
</author>
<published>1996-07-28T16:16:11+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ef1c2ba16fbb102ec646dc48f37c77adb9cb451b'/>
<id>ef1c2ba16fbb102ec646dc48f37c77adb9cb451b</id>
<content type='text'>
 - 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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
 - 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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Suggested by: Bruce Evans, Jeffrey Hsu, Gary Palmer</title>
<updated>1996-06-22T10:34:15+00:00</updated>
<author>
<name>James Raynard</name>
<email>jraynard@FreeBSD.org</email>
</author>
<published>1996-06-22T10:34:15+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ce51cf0392a0b2cc80e5ddcdb01394a303093443'/>
<id>ce51cf0392a0b2cc80e5ddcdb01394a303093443</id>
<content type='text'>
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).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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).
</pre>
</div>
</content>
</entry>
</feed>
