X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=inline;f=lib%2Fsorter%2Fsbuck.c;h=287827ee3359f5a08b4162afee5c0eced00ce09e;hb=9d9c5f728fc131aff8b450da6bce4a0d4414b8ff;hp=53dfed3133c52c7a2fc0cb7a685f1684f08e3b1b;hpb=2ee3df97a48340eea72f09c118c03c1e6d2d436c;p=libucw.git diff --git a/lib/sorter/sbuck.c b/lib/sorter/sbuck.c index 53dfed31..287827ee 100644 --- a/lib/sorter/sbuck.c +++ b/lib/sorter/sbuck.c @@ -144,7 +144,7 @@ sorter_alloc_buf(struct sort_context *ctx) ctx->big_buf_size = 2*bs; ctx->big_buf_half = ((byte*) ctx->big_buf) + bs; ctx->big_buf_half_size = bs; - SORT_XTRACE(2, "Allocated sorting buffer (%jd bytes)", (uintmax_t) bs); + SORT_XTRACE(2, "Allocated sorting buffer (2*%jd bytes)", (uintmax_t) bs); } void @@ -170,6 +170,8 @@ format_size(byte *buf, u64 x) sprintf(buf, "%dM", (int)(x/(1<<20))); else if (x < (u64)10<<30) sprintf(buf, "%.1fG", (double)x/(1<<30)); - else + else if (x != ~(u64)0) sprintf(buf, "%dG", (int)(x/(1<<30))); + else + strcpy(buf, "unknown"); }