fi wrote:
> where mAttribute and mValue are of type nsDependentString. This only
> works if these Strings are not null-terminated. If they are, I get the
> same error. I bind these strings using, e.g.

If that's the case, I suspect you are not interpreting the length 
argument correctly (it's not supposed to include the null terminator).

> If I remember right, I read or inferred from something I read
> somewhere that nsDependentString.Rebind requires the string to be null-
> terminated. Otherwise it will to be copied internally. Is that so?

No, if it's not null terminated, you just get wrong behaviour.

> I
> want to avoid a copy of the strings. Currently my strings are null-
> terminated, but I pass Rebind a length that excludes the '\0' -- this
> at least works with SetAttribute.

Correct. That's what you should do.

It looks like you're using the internal string API, so if you wanted to 
use a non-nullterminated string, you'd use nsDependentSubstring

-christian
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to