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
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;
}