diff --git a/src/rrd_fetch.c b/src/rrd_fetch.c
index b60ea158e53223651b6ac4c54a100c38f97fd000..4f6e084821cbde8734aa950112caf7d96e985ad4 100644 (file)
--- a/src/rrd_fetch.c
+++ b/src/rrd_fetch.c
/*****************************************************************************
- * RRDtool 1.3.2 Copyright by Tobi Oetiker, 1997-2008
+ * RRDtool 1.4.8 Copyright by Tobi Oetiker, 1997-2013
*****************************************************************************
* rrd_fetch.c read date from an rrd to use for further processing
*****************************************************************************
#ifdef HAVE_LIBDBI
/* handle libdbi datasources */
- if (strncmp("sql",filename,3)==0) {
- if (filename[3]==filename[4]) {
+ if (strncmp("sql//",filename,5)==0) {
return rrd_fetch_fn_libdbi(filename,cf_idx,start,end,step,ds_cnt,ds_namv,data);
- }
}
#endif
rra_start_time = (rra_end_time
- (*step * (rrd.rra_def[chosen_rra].row_cnt - 1)));
/* here's an error by one if we don't be careful */
- start_offset = (long) (*start + *step - rra_start_time) / (long) *step;
- end_offset = (long) (rra_end_time - *end) / (long) *step;
+ start_offset = ((long long) *start + (long long)*step - (long long)rra_start_time) / (long long) *step;
+ end_offset = ((long long) rra_end_time - (long long)*end) / (long long) *step;
#ifdef DEBUG
fprintf(stderr,
"rra_start %lu, rra_end %lu, start_off %li, end_off %li\n",