summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1354270)
raw | patch | inline | side by side (parent: 1354270)
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@1385 a5681a0c-68f1-0310-ab6d-d61299d08faa
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1385 a5681a0c-68f1-0310-ab6d-d61299d08faa
program/src/rrd_info.c | patch | blob | history |
diff --git a/program/src/rrd_info.c b/program/src/rrd_info.c
index cf90e0e2b8cbe1115f0589f0029b95cb65c0b9fc..a48df516a3b780aa5d21e2c1d7f44fa315344317 100644 (file)
--- a/program/src/rrd_info.c
+++ b/program/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