In this example any of the (w)printf()'s now call strlen()/wcslen(), even
though the precision is limited to 1 character:
#define __USE_MINGW_ANSI_STDIO 1
#include <stdlib.h>
#include <stdio.h>
int main( void )
{
char *nonTerminated = malloc (1);
wchar_t *nonTerminatedW = malloc (2);
nonTerminated[0] = 'a';
nonTerminatedW[0] = 'b';
printf ("%.1s\n", nonTerminated);
printf ("%.1ls\n", nonTerminatedW);
wprintf (L"%.1s\n", nonTerminated);
wprintf (L"%.1ls\n", nonTerminatedW);
free (nonTerminated);
free (nonTerminatedW);
return 0;
}
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public