Changeset 1f41004e in mainline


Ignore:
Timestamp:
2006-04-23T15:05:58Z (19 years ago)
Author:
Josef Cejka <malyzelenyhnus@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
24f3874
Parents:
ad45bde9
Message:

Kernel printf prefix is counted without prefixes now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/debug/print.c

    rad45bde9 r1f41004e  
    219219        char *ptr = &d[PRINT_NUMBER_BUFFER_SIZE - 1];
    220220        int size = 0;
     221        int number_size; /* size of plain number */
    221222        int written = 0;
    222223        char sgn;
     
    237238        }
    238239
     240        number_size = size;
     241       
    239242        /* Collect sum of all prefixes/signs/... to calculate padding and leading zeroes */
    240243        if (flags & __PRINTF_FLAG_PREFIX) {
     
    273276        if (flags & __PRINTF_FLAG_ZEROPADDED) {
    274277                if ((precision == 0) && (width > size)) {
    275                         precision = width - size;
     278                        precision = width - size + number_size;
    276279                }
    277280        }
    278281
    279282        /* print leading spaces */
    280         if (size > precision) /* We must print the whole number, not only a part */
    281                 precision = size;
    282 
    283         width -= precision;
     283        if (number_size > precision) /* We must print whole number not only a part */
     284                precision = number_size;
     285
     286        width -= precision + size - number_size;
    284287       
    285288        if (!(flags & __PRINTF_FLAG_LEFTALIGNED)) {
     
    326329
    327330        /* print leading zeroes */
    328         precision -= size;
     331        precision -= number_size;
    329332        while (precision-- > 0) {       
    330333                putchar('0');   
Note: See TracChangeset for help on using the changeset viewer.