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

Commit683f60d

Browse files
committed
Add mention of why malloc() has to be used in snprintf.c.
1 parent8c72526 commit683f60d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/port/snprintf.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
* causing nasty effects.
6363
**************************************************************/
6464

65-
/*static char _id[] = "$PostgreSQL: pgsql/src/port/snprintf.c,v 1.25 2005/03/2003:53:39 momjian Exp $";*/
65+
/*static char _id[] = "$PostgreSQL: pgsql/src/port/snprintf.c,v 1.26 2005/03/2013:54:53 momjian Exp $";*/
6666

6767
staticvoiddopr(char*buffer,constchar*format,va_listargs,char*end);
6868

@@ -225,6 +225,7 @@ dopr(char *buffer, const char *format, va_list args, char *end)
225225
if (*p=='%')/* counts %% as two, so overcounts */
226226
percents++;
227227

228+
/* Need to use malloc() because memory system might not be started yet. */
228229
if ((fmtpar=malloc(sizeof(structfmtpar)*percents))==NULL)
229230
{
230231
fprintf(stderr,_("out of memory\n"));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp