From 89114046705c7df4a3792d5cdd8ac2dd933203a5 Mon Sep 17 00:00:00 2001 From: solar Date: Tue, 20 Jul 2010 04:27:34 +0000 Subject: [PATCH] Formatting bug. git-svn-id: https://srv7.svn-repos.de/dev34/pdclib/trunk@455 546481bc-9713-0410-bf18-d3337bbf4a3e --- functions/_PDCLIB/print.c | 1 + testing/printf_testcases.incl | 2 ++ 2 files changed, 3 insertions(+) diff --git a/functions/_PDCLIB/print.c b/functions/_PDCLIB/print.c index 41b3bd9..365de3f 100644 --- a/functions/_PDCLIB/print.c +++ b/functions/_PDCLIB/print.c @@ -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 ); diff --git a/testing/printf_testcases.incl b/testing/printf_testcases.incl index 09eab2d..84c7968 100644 --- a/testing/printf_testcases.incl +++ b/testing/printf_testcases.incl @@ -348,6 +348,8 @@ /* 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; -- 2.30.2