Changeset 226a654 in mainline


Ignore:
Timestamp:
2006-03-17T09:57:42Z (19 years ago)
Author:
Josef Cejka <malyzelenyhnus@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5a7d9d1
Parents:
8a0b0669
Message:

Printf correctly handle NULL pointer as parameter to %s option.

Files:
2 edited

Legend:

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

    r8a0b0669 r226a654  
    5151        int i = 0;
    5252        char c;
     53        char errstr[] = "(NULL)";
     54
     55        if (str == NULL) {
     56                while ((c = errstr[i++]))
     57                        putchar(c);
     58                return;
     59        }       
    5360       
    5461        while ((c = str[i++]))
  • test/print/print1/test.c

    r8a0b0669 r226a654  
    3838        printf(" W  %W  %w \n",0x0123 ,0x0123);   
    3939        printf(" B  %B  %b \n",0x01 ,0x01);
     40        printf(" Print to NULL '%s'\n",NULL);
    4041        return;
    4142}
Note: See TracChangeset for help on using the changeset viewer.