chrome newer version(14) does not give a null terminated string as part of NPVariant whereas firefox acts differently and gives a null terminated string. Is that expected ??
What can we do other than extracting a string,allocating memory and add null character and then deallocating the same..... all this just to add a null character??
NPVariant NPStrings have never been required to include a NULL terminated string. Sometimes they did anyway. What they do include, however, is a "length" to indicate how long the string is; I generally just convert it to a std::string like so:
That is how FireBreath does it; https://github.com/firebreath/FireBreath/blob/master/src/NpapiCore/NpapiBrowserHost.cpp#L253