]> pd.if.org Git - pdclib/commitdiff
Formatting bug.
authorsolar <unknown>
Tue, 20 Jul 2010 04:27:34 +0000 (04:27 +0000)
committersolar <unknown>
Tue, 20 Jul 2010 04:27:34 +0000 (04:27 +0000)
functions/_PDCLIB/print.c
testing/printf_testcases.incl

index 41b3bd98afdaca2392f6da4fab2be6e96b4cad10..365de3f2849b4303dca7758bef0757bbafccbd1f 100644 (file)
@@ -451,6 +451,7 @@ const char * _PDCLIB_print( const char * spec, struct _PDCLIB_status_t * status
                     break;
             }
             ++(status->current);
+            /* FIXME: The if clause means one-digit values do not get formatted */
             if ( ( value / status->base ) != 0 )
             {
                 int2base( (intmax_t)(value / status->base), status );
index 09eab2d3df746e7c7d1b1e9a3b65e03f3f9ce569..84c7968f40d48e76486cfaeedb7b752083f22ae8 100644 (file)
     /* FIXME: This test not yet 32/64 bit agnostic */
     TESTCASE( testprintf( buffer, 100, "%p", (void *)0xdeadbeef ) == 10 );
     TESTCASE_SPRINTF( strcmp( buffer, "0xdeadbeef" ) == 0 );
+    TESTCASE( testprintf( buffer, 100, "%#6x", 1 ) == 6 );
+    TESTCASE_SPRINTF( strcmp( buffer, "0x0001" ) == 0 );
 #ifndef TEST_CONVERSION_ONLY
     {
         int val1, val2;