Inline check for full buffer in appendStringInfoChar.
This commit is contained in:
parent
e81ad79de0
commit
ee2ad1cf2e
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: stringinfo.c,v 1.22 1999/09/08 16:31:38 tgl Exp $
|
* $Id: stringinfo.c,v 1.23 1999/11/01 05:10:32 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -146,10 +146,9 @@ appendStringInfo(StringInfo str, const char *fmt,...)
|
|||||||
void
|
void
|
||||||
appendStringInfoChar(StringInfo str, char ch)
|
appendStringInfoChar(StringInfo str, char ch)
|
||||||
{
|
{
|
||||||
Assert(str != NULL);
|
|
||||||
|
|
||||||
/* Make more room if needed */
|
/* Make more room if needed */
|
||||||
enlargeStringInfo(str, 1);
|
if (str->len + 1 >= str->maxlen)
|
||||||
|
enlargeStringInfo(str, 1);
|
||||||
|
|
||||||
/* OK, append the character */
|
/* OK, append the character */
|
||||||
str->data[str->len] = ch;
|
str->data[str->len] = ch;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user