diff --git a/src/core.c b/src/core.c index cc89502d..32aa1c04 100644 --- a/src/core.c +++ b/src/core.c @@ -1499,7 +1499,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long END OBJ(entropy_poolsize, &update_entropy) obj->callbacks.print = &print_entropy_poolsize; END OBJ(entropy_bar, &update_entropy) - scan_bar(obj, arg, 255); + scan_bar(obj, arg, 1); obj->callbacks.barval = &entropy_barval; END OBJ_ARG(include, 0, "include needs a argument") struct conftree *leaf = conftree_add(currentconffile, arg); diff --git a/src/entropy.c b/src/entropy.c index 1de29604..9034a093 100644 --- a/src/entropy.c +++ b/src/entropy.c @@ -73,9 +73,9 @@ void print_entropy_poolsize(struct text_object *obj, char *p, int p_max_size) snprintf(p, p_max_size, "%u", entropy.poolsize); } -uint8_t entropy_barval(struct text_object *obj) +double entropy_barval(struct text_object *obj) { (void)obj; - return round_to_int((double) entropy.avail * 255.0f / (double) entropy.poolsize); + return (double)entropy.avail / entropy.poolsize; } diff --git a/src/entropy.h b/src/entropy.h index 8b998d0f..eaacf455 100644 --- a/src/entropy.h +++ b/src/entropy.h @@ -36,6 +36,6 @@ void update_entropy(void); void print_entropy_avail(struct text_object *, char *, int); uint8_t entropy_percentage(struct text_object *); void print_entropy_poolsize(struct text_object *, char *, int); -uint8_t entropy_barval(struct text_object *); +double entropy_barval(struct text_object *); #endif /* _ENTROPY_H */