This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch for pformat.c in winsup/mingw CVS


Hi,

The latest CVS winsup/mingw runtime caused a crash, for me, in strlen() when
testing previously 'good' code built with it in the toolchain.
I found this patch fixed the problem for me, so it may be of help to
others...

--- ./mingw/mingwex/stdio/save_pformat.c        2008-07-29
00:24:20.000000000 +0100
+++ ./mingw/mingwex/stdio/pformat.c     2008-07-31 19:30:29.000000000 +0100
@@ -358,7 +358,7 @@
    * This is implemented as a trivial call to `__pformat_putchars()',
    * passing the length of the input string as the character count.
    */
-  __pformat_putchars( s, strlen( s ), stream );
+  __pformat_putchars( s, s ? strlen( s ) : 0, stream );
 }

 static
@@ -436,7 +436,7 @@
    * This is implemented as a trivial call to `__pformat_wputchars()',
    * passing the length of the input string as the character count.
    */
-  __pformat_wputchars( s, wcslen( s ), stream );
+  __pformat_wputchars( s, s ? wcslen( s ) : 0, stream );
 }

 static __inline__

Thanks
Colin Harrison


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]