summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ee663bc)
raw | patch | inline | side by side (parent: ee663bc)
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) |
program/src/rrd_graph.c | patch | blob | history |
index b6d5bebb4b88dd4c01bd682a2a5535aed1875334..8aa71560b8c60ef554c00c50cc28d0bad2ca5ff8 100644 (file)
--- a/program/src/rrd_graph.c
+++ b/program/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;