X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=dus.git;a=blobdiff_plain;f=dus.c;h=b90a0bdddc0648f1fc2735e199b1a300b580550d;hp=a9ceedca5940bc3001b6b6e8467122234f5a1a9a;hb=b2fe75d8869c39badff3381fd9bde0f58b8ee7ce;hpb=2a34d616bedb35238b4c3e402d14062e06d79910 diff --git a/dus.c b/dus.c index a9ceedc..b90a0bd 100644 --- a/dus.c +++ b/dus.c @@ -136,6 +136,9 @@ size_sum_t atoss(const char *string) { for(c = string; *c; c++) { if(*c >= '0' && *c <= '9') { partial_total = 10 * partial_total + ((int) (*c - '0')); + } else if(*c == 'B' || *c == 'b') { + total += partial_total; + partial_total = 0; } else if(*c == 'K' || *c == 'k') { total += partial_total * 1024; partial_total = 0;