Make various buffers larger

MAXLEN definitely needed to be bigger to properly format fairly common
connection strings.  In addition, the reliance on xsnprintf helps
detect cases where even this buffer is not long enough.

the buffer in parse_config has been made bigger in a bit of sloppy
programming, but what really needs to happen is reporting when a line
cannot be properly parsed/is too big for the buffer.  That is just a
kludge.

Signed-off-by: Dan Farina <drfarina@acm.org>
Signed-off-by: Peter van Hardenberg <pvh@heroku.com>
This commit is contained in:
Dan Farina
2010-12-10 12:55:45 -08:00
committed by Peter van Hardenberg
parent fc13d50e37
commit ec73a07e2f
2 changed files with 2 additions and 2 deletions

View File

@@ -15,7 +15,7 @@ void
parse_config(const char *config_file, char *cluster_name, int *node,
char *conninfo)
{
char *s, buff[256];
char *s, buff[1024];
FILE *fp = fopen (config_file, "r");
if (fp == NULL)

View File

@@ -9,7 +9,7 @@
#define _STRUTIL_H_
#define QUERY_STR_LEN 8192
#define MAXLEN 80
#define MAXLEN 1024
extern int xsnprintf(char *str, size_t size, const char *format, ...);