- if (tot <0) { /* nothing found */
- *current = -1;
- *total = -1;
- } else if (tot < 1) { /* most likely tot==0 */
- *current = 0;
- *total = 0;
- } else {
- r = scur/stot;
- *current = (double) p->hits;
- *total=*current/r ;
- }
- yaz_log(YLOG_DEBUG,"prox_pos: [%d] %0.1f/%0.1f= %0.4f ",
- i,*current, *total, r);
+ *current = (double) p->hits;
+ if (ratio > 0.0)
+ *total = *current/ratio;
+ else
+ *total = 0.0;
+
+ yaz_log(YLOG_DEBUG, "prox_pos: [%d] %0.1f/%0.1f= %0.4f ",
+ i, *current, *total, ratio);