mbstocws special case not handled

Hello,
I think there might be a problem with

size_t mbstowcs( wchar_t * pwcs, const char * s, size_t n );

under QNX 6.2NC.
Well, perhaps it is a decision not to support this special case, but as I
understand
the function, if ‘pwcs’ is NULL then mbstowcs will return the length
required to convert ‘s’,
but will not actually store anything. It will also, therefore, ignore ‘n’.

Can someone shed some light on this issue?
I’ve done a sample program and indeed the special pwcs = NULL case is
broken.
Here’s the sample:
You’ll get a 0 (zero) for len, which is in correct!!
TIA,
Kevin

#include <stdio.h>
#include <stdlib.h>

int main( void )
{
char *wc = “./in.xml”;
wchar_t wbuffer[50];
int i, len;
len = mbstowcs( NULL, wc, 0 );
if( len != -1 )
{
wbuffer[len] = ‘\0’;
printf( “%s(%d)\n”, wc, len );

for( i = 0; i < len; i++ )
{
printf( “/%4.4x”, wbuffer );
}

printf( “\n” );
printf(“len=%d\n”, len);
}

return EXIT_SUCCESS;
}