nsCAutoString nextValStr(CBufDescriptor(buf, PR_TRUE, sizeof(buf)));
nsCAutoString nextValStr(CBufDescriptor(buf, PR_TRUE, sizeof(buf), 0));
RDFContainerImpl::GetNextValue(nsIRDFResource** aResult){    NS_PRECONDITION(aResult != nsnull, "null ptr");    if (! aResult)        return NS_ERROR_NULL_POINTER;    nsresult rv;    // Get the next value, which hangs off of the bag via the    // RDF:nextVal property.    nsCOMPtr<nsIRDFNode> nextValNode;    rv = mDataSource->GetTarget(mContainer, kRDF_nextVal, PR_TRUE, getter_AddRefs(nextValNode));    if (NS_FAILED(rv)) return rv;    if (rv == NS_RDF_NO_VALUE)        return NS_ERROR_UNEXPECTED;    nsCOMPtr<nsIRDFLiteral> nextValLiteral;    rv = nextValNode->QueryInterface(nsIRDFLiteral::GetIID(), getter_AddRefs(nextValLiteral));    if (NS_FAILED(rv)) return rv;    const PRUnichar* s;    rv = nextValLiteral->GetValueConst(&s);    if (NS_FAILED(rv)) return rv;    PRInt32 nextVal = 0;    {        for (const PRUnichar* p = s; *p != 0; ++p) {            NS_ASSERTION(*p >= '0' && *p <= '9', "not a digit");            if (*p < '0' || *p > '9')                break;            nextVal *= 10;            nextVal += *p - '0';        }    }    char buf[sizeof(kRDFNameSpaceURI) + 16];    nsCAutoString nextValStr(CBufDescriptor(buf, PR_TRUE, sizeof(buf)));    nextValStr = kRDFNameSpaceURI;    nextValStr.Append("_");    nextValStr.Append(nextVal, 10);    rv = gRDFService->GetResource((const char*) nextValStr, aResult);    if (NS_FAILED(rv)) return rv;    // Now increment the RDF:nextVal property.    rv = mDataSource->Unassert(mContainer, kRDF_nextVal, nextValLiteral);    if (NS_FAILED(rv)) return rv;    ++nextVal;    nextValStr.Truncate();    nextValStr.Append(nextVal, 10);    rv = gRDFService->GetLiteral(nsAutoString(nextValStr).GetUnicode(), getter_AddRefs(nextValLiteral));    if (NS_FAILED(rv)) return rv;    rv = mDataSource->Assert(mContainer, kRDF_nextVal, nextValLiteral, PR_TRUE);    if (NS_FAILED(rv)) return rv;    return NS_OK;}