From 03512fe86d5d319f00a4bcbcb834070f78d84336 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Thu, 20 May 2004 22:16:12 +0000 Subject: [PATCH] ICU-3499 Mirror more of the printf implementation in case it has to be merged even more. X-SVN-Rev: 15444 --- icu4c/source/io/uprintf.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/icu4c/source/io/uprintf.c b/icu4c/source/io/uprintf.c index c3143ae9b4a..3a02adbfce4 100644 --- a/icu4c/source/io/uprintf.c +++ b/icu4c/source/io/uprintf.c @@ -150,6 +150,7 @@ u_vfprintf_u( UFILE *f, va_list ap) { const UChar *alias = patternSpecification; /* alias the pattern */ + const UChar *lastAlias; int32_t patCount; int32_t written = 0; /* haven't written anything yet */ @@ -157,15 +158,14 @@ u_vfprintf_u( UFILE *f, for(;;) { /* find the next '%' */ - patCount = 0; + lastAlias = alias; while(*alias != UP_PERCENT && *alias != 0x0000) { alias++; - ++patCount; } /* write any characters before the '%' */ - if(patCount > 0) { - written += (*g_stream_handler.write)(f, alias - patCount, patCount); + if(alias > lastAlias) { + written += (*g_stream_handler.write)(f, lastAlias, (int32_t)(alias - lastAlias)); } /* break if at end of string */ @@ -174,7 +174,7 @@ u_vfprintf_u( UFILE *f, } /* parse and print the specifier */ - patCount = u_printf_print_spec(&g_stream_handler, alias, f, &f->str.fBundle, patCount, &written, (va_list*)&ap); + patCount = u_printf_print_spec(&g_stream_handler, alias, f, &f->str.fBundle, (int32_t)(alias - lastAlias), &written, (va_list*)&ap); /* update the pointer in pattern and continue */ alias += patCount;