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
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
Here’s the sample:
You’ll get a 0 (zero) for len, which is in correct!!
int main( void )
char *wc = “./in.xml”;
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” );