[EMAIL PROTECTED] wrote:
>       PRUnichar *szRet = (PRUnichar*)NS_Alloc(lstrlen(sz)+2);

Actually the code is wrong even if you define UNICODE. lstrlen doesn't 
return a number of bytes, it returns a number of characters. Therefore, 
you need to multiply its return value by two:

   PRUnichar *szRet = reinterpret_cast<PRUnichar*>(
                                     NS_Alloc(2*lstrlen(sz)+2));



-- 
All the world's a stage,
And all the men and women merely players:
They have their exits and their entrances;
And one man in his time plays many parts, [...]     --W. Shakespeare
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to