__pformat_wputchars() for snprintf, __pformat_puchats() for swprintf and
__pformat_puchats() for snprintf prints all characters including nul chars.
So change __pformat_wputchars() for swprintf to align this behavior.

This change is needed for swprintf(%wZ) support in follow up change.
---
 mingw-w64-crt/stdio/mingw_pformat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mingw-w64-crt/stdio/mingw_pformat.c 
b/mingw-w64-crt/stdio/mingw_pformat.c
index 9c22aff144fd..a2ef12da2de8 100644
--- a/mingw-w64-crt/stdio/mingw_pformat.c
+++ b/mingw-w64-crt/stdio/mingw_pformat.c
@@ -657,7 +657,7 @@ void __pformat_wputchars( const wchar_t *s, int count, 
__pformat_t *stream )
       __pformat_putc( '\x20', stream );
 
   len = count;
-  while(len-- > 0 && *s != 0)
+  while(len-- > 0)
   {
       __pformat_putc(*s++, stream);
   }
-- 
2.20.1



_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to