summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5caa99f)
raw | patch | inline | side by side (parent: 5caa99f)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 9 Nov 2008 00:00:33 +0000 (00:00 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 9 Nov 2008 00:00:33 +0000 (00:00 +0000) |
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.3/program@1662 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_graph.c | patch | blob | history |
diff --git a/src/rrd_graph.c b/src/rrd_graph.c
index 46bf73646b7c116415af1586534a958e8b7c5eab..41f99f6c2a3622c3910a21d60264858f95ed8350 100644 (file)
--- a/src/rrd_graph.c
+++ b/src/rrd_graph.c
if (im.imginfo) {
rrd_infoval_t info;
+ char *path;
char *filename;
- filename = im.graphfile + strlen(im.graphfile);
- while (filename > im.graphfile) {
- if (*(filename - 1) == '/' || *(filename - 1) == '\\')
- break;
- filename--;
- }
+ path = strdup(im.graphfile);
+ filename = basename(path);
info.u_str =
sprintf_alloc(im.imginfo,
filename,
im.ximg), (long) (im.zoom * im.yimg));
grinfo_push(&im, sprintf_alloc("image_info"), RD_I_STR, info);
free(info.u_str);
+ free(path);
}
if (im.rendered_image) {
rrd_infoval_t img;