pgpool2.git / summary / log / commit / refs
commit 8de1fbbd38f828ae53b5f6a84cbb2d3e8130db00
Author: Muhammad Usama <m.usama@gmail.com>
Date: Thu Apr 30 12:26:30 2015 +0000
pgpool-II should only use the local definition of snprintf functions if they are not provided by OS.
Fixing a small oversight in the code which was causing the pgpool-II to always
use the local definition of snprintf functions even when the functions are
provided by the host OS.
src/include/parser/stringinfo.h | 3 +++
src/parser/stringinfo.c | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/include/parser/stringinfo.h b/src/include/parser/stringinfo.h
index 2baa97511..5398a50e7 100644
--- a/src/include/parser/stringinfo.h
+++ b/src/include/parser/stringinfo.h
@@ -21,6 +21,7 @@
#include <stdio.h>
#include "pg_config_manual.h"
+#ifdef USE_REPL_SNPRINTF
/* port.h */
extern int pg_vsnprintf(char *str, size_t count, const char *fmt, va_list args);
@@ -38,6 +39,8 @@ extern int pg_vsnprintf(char *str, size_t count, const char *fmt, va_list args);
#endif
#endif
+#endif /* USE_REPL_SNPRINTF */
+
/* utils.memutils.h */
#include "pool_parser.h"
diff --git a/src/parser/stringinfo.c b/src/parser/stringinfo.c
index 58ae2cc57..ca6b52d9c 100644
--- a/src/parser/stringinfo.c
+++ b/src/parser/stringinfo.c
@@ -133,7 +133,7 @@ appendStringInfoVA(StringInfo str, const char *fmt, va_list args)
str->data[str->maxlen - 1] = '\0';
#endif
- nprinted = vsnprintf(str->data + str->len, avail, fmt, args);
+ nprinted = pvsnprintf(str->data + str->len, (size_t) avail, fmt, args);
/*
* Note: some versions of vsnprintf return the number of chars actually
[parent: a3f6479168d2]