Changeset fcfac250 in mainline for uspace/lib/fmtutil/fmtutil.c


Ignore:
Timestamp:
2011-08-21T08:15:13Z (13 years ago)
Author:
Martin Sucha <sucha14@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
19d007e
Parents:
e406736
Message:

Use proper formula to calculate number of spaces between words when using ALIGN_JUSITFY

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/fmtutil/fmtutil.c

    re406736 rfcfac250  
    145145                        if (i == len) break;
    146146                        if (done_words) {
    147                                 // TODO: use better formula
    148                                 size_t spaces = 1 + (excess_spaces /
    149                                     (words - 1));
     147                                size_t spaces = 1 + (((done_words *
     148                                    excess_spaces) / (words - 1)) -
     149                                    (((done_words - 1) * excess_spaces) /
     150                                    (words - 1)));
    150151                                for (j = 0; j < spaces; j++) {
    151152                                        putchar(' ');
Note: See TracChangeset for help on using the changeset viewer.