Changeset 64a617f in mainline


Ignore:
Timestamp:
2012-04-17T10:21:04Z (12 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
63920b0
Parents:
96c0b7b
Message:

backport printf fixes to kernel and boot

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • boot/generic/src/printf_core.c

    r96c0b7b r64a617f  
    210210        /* Print leading spaces. */
    211211        size_t strw = str_length(str);
    212         if (precision == 0)
     212        if ((precision == 0) || (precision > strw))
    213213                precision = strw;
    214214       
  • kernel/generic/src/printf/printf_core.c

    r96c0b7b r64a617f  
    284284        /* Print leading spaces. */
    285285        size_t strw = str_length(str);
    286         if (precision == 0)
     286        if ((precision == 0) || (precision > strw))
    287287                precision = strw;
    288288       
     
    332332        /* Print leading spaces. */
    333333        size_t strw = wstr_length(str);
    334         if (precision == 0)
     334        if ((precision == 0) || (precision > strw))
    335335                precision = strw;
    336336       
  • kernel/test/print/print1.c

    r96c0b7b r64a617f  
    4141       
    4242        TPRINTF("Testing printf(\"%%8.10s\", \"text\"):\n");
    43         TPRINTF("Expected output: \"text\"\n");
     43        TPRINTF("Expected output: \"    text\"\n");
    4444        TPRINTF("Real output:     \"%8.10s\"\n\n", "text");
    4545       
     
    4848        TPRINTF("Real output:     \"%8.10s\"\n\n", "very long text");
    4949       
     50        TPRINTF("Testing printf(\"%%-*.*s\", 7, 7, \"text\"):\n");
     51        TPRINTF("Expected output: \"text   \"\n");
     52        TPRINTF("Real output:     \"%-*.*s\"\n\n", 7, 7, "text");
     53       
    5054        return NULL;
    5155}
  • uspace/lib/c/generic/io/printf_core.c

    r96c0b7b r64a617f  
    283283        /* Print leading spaces. */
    284284        size_t strw = str_length(str);
    285         if (precision == 0 || precision > strw)
     285        if ((precision == 0) || (precision > strw))
    286286                precision = strw;
    287287       
     
    331331        /* Print leading spaces. */
    332332        size_t strw = wstr_length(str);
    333         if (precision == 0 || precision > strw)
     333        if ((precision == 0) || (precision > strw))
    334334                precision = strw;
    335335       
Note: See TracChangeset for help on using the changeset viewer.