- pthread_mutex_lock(&(df->mutex));
- if (index + amount >= df->num_points)
- {
- Log(LOGDEBUG, "Requested %d points but will only read %d to get to EOF", amount, df->num_points - index);
- amount = df->num_points - index;
- }
- pthread_mutex_unlock(&(df->mutex));
+
+ if (index + amount > df->num_points)
+ {
+ Log(LOGDEBUG, "Requested %d points but will only read %d to get to EOF (%d)", amount, df->num_points - index, df->num_points);
+ amount = df->num_points - index;
+ }
+