X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=blobdiff_plain;f=src%2Frrd_graph.c;h=3c2795aeba697993d95053a92873dfa5006996f9;hp=5c739becc9cf8459cbdaf0042f957815ce2cc2b4;hb=6a6710c10c23a986534f4a8971162afa2813c363;hpb=c6824ca3f64bd2945fa4b6a772ae5322949d399f diff --git a/src/rrd_graph.c b/src/rrd_graph.c index 5c739be..3c2795a 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -1582,7 +1582,7 @@ int print_calc( } } /* prepare printval */ - if ((percent_s = strstr(im->gdes[i].format, "%S")) != NULL) { + if (!im->gdes[i].strftm && (percent_s = strstr(im->gdes[i].format, "%S")) != NULL) { /* Magfact is set to -1 upon entry to print_calc. If it * is still less than 0, then we need to run auto_scale. * Otherwise, put the value into the correct units. If @@ -1596,7 +1596,7 @@ int print_calc( printval /= magfact; } *(++percent_s) = 's'; - } else if (strstr(im->gdes[i].format, "%s") != NULL) { + } else if (!im->gdes[i].strftm && strstr(im->gdes[i].format, "%s") != NULL) { auto_scale(im, &printval, &si_symb, &magfact); } @@ -2301,7 +2301,7 @@ int horizontal_log_grid( } } else { - sprintf(graph_label_right,im->second_axis_format,sval); + sprintf(graph_label_right,im->second_axis_format,sval,""); } gfx_text ( im, @@ -3991,15 +3991,18 @@ rrd_info_t *rrd_graph_v( char *old_locale; rrd_graph_init(&im); /* a dummy surface so that we can measure text sizes for placements */ - old_locale = setlocale(LC_NUMERIC, "C"); + old_locale = setlocale(LC_NUMERIC, NULL); + setlocale(LC_NUMERIC, "C"); rrd_graph_options(argc, argv, &im); if (rrd_test_error()) { + setlocale(LC_NUMERIC, old_locale); /* reenable locale */ rrd_info_free(im.grinfo); im_free(&im); return NULL; } if (optind >= argc) { + setlocale(LC_NUMERIC, old_locale); /* reenable locale */ rrd_info_free(im.grinfo); im_free(&im); rrd_set_error("missing filename"); @@ -4007,6 +4010,7 @@ rrd_info_t *rrd_graph_v( } if (strlen(argv[optind]) >= MAXPATH) { + setlocale(LC_NUMERIC, old_locale); /* reenable locale */ rrd_set_error("filename (including path) too long"); rrd_info_free(im.grinfo); im_free(&im);