summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f501efa)
raw | patch | inline | side by side (parent: f501efa)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Tue, 27 May 2008 22:24:32 +0000 (22:24 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Tue, 27 May 2008 22:24:32 +0000 (22:24 +0000) |
makes imginfo work even when there are long image paths.
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1385 a5681a0c-68f1-0310-ab6d-d61299d08faa
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1385 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_info.c | patch | blob | history |
diff --git a/src/rrd_info.c b/src/rrd_info.c
index cf90e0e2b8cbe1115f0589f0029b95cb65c0b9fc..a48df516a3b780aa5d21e2c1d7f44fa315344317 100644 (file)
--- a/src/rrd_info.c
+++ b/src/rrd_info.c
char *fmt,
...)
{
-#ifdef HAVE_VSNPRINTF
- int maxlen = 50;
-#else
- int maxlen = 1000;
-#endif
+ int maxlen = 1024 + strlen(fmt);
char *str = NULL;
va_list argp;
- str = malloc(sizeof(char) * (strlen(fmt) + maxlen));
+ str = malloc(sizeof(char) * (maxlen+1));
if (str != NULL) {
va_start(argp, fmt);
#ifdef HAVE_VSNPRINTF
- vsnprintf(str, maxlen - 1, fmt, argp);
+ vsnprintf(str, maxlen, fmt, argp);
#else
vsprintf(str, fmt, argp);
#endif