--- embedaddon/bmon/src/unit.c 2014/07/30 07:55:27 1.1.1.1 +++ embedaddon/bmon/src/unit.c 2019/10/21 14:58:35 1.1.1.2 @@ -28,7 +28,7 @@ #include #include -static struct unit *byte_unit, *bit_unit, *number_unit; +static struct unit *byte_unit, *bit_unit; static LIST_HEAD(units); @@ -124,6 +124,7 @@ void fraction_free(struct fraction *f) if (!f) return; + list_del(&f->f_list); xfree(f->f_name); xfree(f); } @@ -190,7 +191,7 @@ char *unit_bytes2str(uint64_t bytes, char *buf, size_t v = unit_value2str(bytes, byte_unit, &ustr, &prec); snprintf(buf, len, "%'.*f%3s", prec, v, ustr); } else - snprintf(buf, len, "%llu", (unsigned long long) bytes); + snprintf(buf, len, "%" PRIu64, bytes); return buf; } @@ -205,7 +206,7 @@ char *unit_bit2str(uint64_t bits, char *buf, size_t le v = unit_value2str(bits, bit_unit, &ustr, &prec); snprintf(buf, len, "%'.*f%3s", prec, v, ustr); } else - snprintf(buf, len, "%llu", (unsigned long long) bits); + snprintf(buf, len, "%" PRIu64, bits); return buf; }