projects
/
users
/
bernd
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2b295e8
)
Add mention of why malloc() has to be used in snprintf.c.
author
Bruce Momjian
<
[email protected]
>
Sun, 20 Mar 2005 13:54:53 +0000
(13:54 +0000)
committer
Bruce Momjian
<
[email protected]
>
Sun, 20 Mar 2005 13:54:53 +0000
(13:54 +0000)
src/port/snprintf.c
patch
|
blob
|
blame
|
history
diff --git
a/src/port/snprintf.c
b/src/port/snprintf.c
index d122026a3b3f5c93492f3534d57b373c9664ea4b..c48f7336ddcb2a4d60cc64f65029aedc8677f41a 100644
(file)
--- a/
src/port/snprintf.c
+++ b/
src/port/snprintf.c
@@
-225,6
+225,7
@@
dopr(char *buffer, const char *format, va_list args, char *end)
if (*p == '%') /* counts %% as two, so overcounts */
percents++;
+ /* Need to use malloc() because memory system might not be started yet. */
if ((fmtpar = malloc(sizeof(struct fmtpar) * percents)) == NULL)
{
fprintf(stderr, _("out of memory\n"));