summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 30d277c)
raw | patch | inline | side by side (parent: 30d277c)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 7 Jun 2009 14:12:28 +0000 (14:12 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 7 Jun 2009 14:12:28 +0000 (14:12 +0000) |
program/src/rrd_fetch.c | patch | blob | history | |
program/src/rrd_flushcached.c | patch | blob | history | |
program/src/rrd_info.c | patch | blob | history |
index 23be6e03d805b898c9243092f379c3021d4352f1..2c30a980735dd40f24b6fb575672ea6e8c1ef865 100644 (file)
--- a/program/src/rrd_fetch.c
+++ b/program/src/rrd_fetch.c
long best_full_step_diff = 0, best_part_step_diff =
0, tmp_step_diff = 0, tmp_match = 0, best_match = 0;
long full_match, rra_base;
- long start_offset, end_offset;
+ off_t start_offset, end_offset;
int first_full = 1;
int first_part = 1;
rrd_t rrd;
rra_start_time, rra_end_time, start_offset, end_offset);
#endif
/* only seek if the start time is before the end time */
- if (*start <= rra_end_time && *end >= rra_start_time - *step ){
+ if (*start <= rra_end_time && *end >= rra_start_time - (off_t)*step ){
if (start_offset <= 0)
rra_pointer = rrd.rra_ptr[chosen_rra].cur_row + 1;
else
index fb9345b4ea8ee1382257c9ce567a2fe71840b121..f7a715e110c85528ae991decff7ea10a8eecd5a7 100644 (file)
}
status = 0;
- for (int i = optind; i < argc; i++)
+ for (i = optind; i < argc; i++)
{
status = rrdc_flush(argv[i]);
if (status)
diff --git a/program/src/rrd_info.c b/program/src/rrd_info.c
index 73407a95c7d760f14f6cc190708201fcc9ab30d3..3ab1b592da1a323594689713a5b1654ed53318dd 100644 (file)
--- a/program/src/rrd_info.c
+++ b/program/src/rrd_info.c
char *str = NULL;
va_list argp;
#ifdef HAVE_VASPRINTF
- va_start( argp, fmt );
- vasprintf( &str, fmt, argp );
+ va_start( argp, fmt );
+ if (vasprintf( &str, fmt, argp ) == -1){
+ va_end(argp);
+ rrd_set_error ("vasprintf failed.");
+ return(NULL);
+ }
#else
int maxlen = 1024 + strlen(fmt);
str = (char*)malloc(sizeof(char) * (maxlen + 1));
vsprintf(str, fmt, argp);
#endif
}
-#endif // HAVE_VASPRINTF
+#endif /* HAVE_VASPRINTF */
va_end(argp);
return str;
}