diff --git a/src/rrd_fetch.c b/src/rrd_fetch.c
index ac426e8fdf83a1ad5161379b703748bfece54915..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
*****************************************************************************
*****************************************************************************
* rrd_fetch.c read date from an rrd to use for further processing
*****************************************************************************
- * $Id: rrd_fetch.c 1849 2009-06-07 14:12:28Z oetiker $
+ * $Id$
* $Log$
* Revision 1.8 2004/05/18 18:53:03 oetiker
* big spell checking patch -- slif@bellsouth.net
* $Log$
* Revision 1.8 2004/05/18 18:53:03 oetiker
* big spell checking patch -- slif@bellsouth.net
*step = step_tmp;
if (optind + 1 >= argc) {
*step = step_tmp;
if (optind + 1 >= argc) {
- rrd_set_error("not enough arguments");
+ rrd_set_error("Usage: rrdtool %s <file> <CF> [options]", argv[0]);
return -1;
}
return -1;
}
#ifdef HAVE_LIBDBI
/* handle libdbi datasources */
#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);
return rrd_fetch_fn_libdbi(filename,cf_idx,start,end,step,ds_cnt,ds_namv,data);
- }
}
#endif
}
#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 */
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",
#ifdef DEBUG
fprintf(stderr,
"rra_start %lu, rra_end %lu, start_off %li, end_off %li\n",