From ec73a07e2f654d653ae7b2cd17e722ce32cf0e78 Mon Sep 17 00:00:00 2001 From: Dan Farina Date: Fri, 10 Dec 2010 12:55:45 -0800 Subject: [PATCH] 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 Signed-off-by: Peter van Hardenberg --- config.c | 2 +- strutil.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.c b/config.c index 41e4bffa..1a4b5b07 100644 --- a/config.c +++ b/config.c @@ -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) diff --git a/strutil.h b/strutil.h index c2f5d55c..efefff7b 100644 --- a/strutil.h +++ b/strutil.h @@ -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, ...);