char *aptr, *bptr;
int ahas, bhas;
int result = 0;
+ double difference;
/* Firstly, require spam attributes for both msgs */
/* to compare. Determine which msgs have one. */
/* Both have spam attrs. */
/* preliminary numeric examination */
- result = (strtoul((*ppa)->env->spam->data, &aptr, 10) -
- strtoul((*ppb)->env->spam->data, &bptr, 10));
+ difference = (strtod((*ppa)->env->spam->data, &aptr) -
+ strtod((*ppb)->env->spam->data, &bptr));
+
+ /* map double into comparison (-1, 0, or 1) */
+ result = (difference < 0.0 ? -1 : difference > 0.0 ? 1 : 0);
/* If either aptr or bptr is equal to data, there is no numeric */
/* value for that spam attribute. In this case, compare lexically. */