Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitee2ad1c

Browse files
committed
Inline check for full buffer in appendStringInfoChar.
1 parente81ad79 commitee2ad1c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

‎src/backend/lib/stringinfo.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $Id: stringinfo.c,v 1.22 1999/09/08 16:31:38 tgl Exp $
11+
* $Id: stringinfo.c,v 1.23 1999/11/01 05:10:32 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -146,10 +146,9 @@ appendStringInfo(StringInfo str, const char *fmt,...)
146146
void
147147
appendStringInfoChar(StringInfostr,charch)
148148
{
149-
Assert(str!=NULL);
150-
151149
/* Make more room if needed */
152-
enlargeStringInfo(str,1);
150+
if (str->len+1 >=str->maxlen)
151+
enlargeStringInfo(str,1);
153152

154153
/* OK, append the character */
155154
str->data[str->len]=ch;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp