Joris Huizer joris_huizer@yahoo.com writes:
@@ -511,24 +511,27 @@ static HRESULT GAMEUX_loadStatisticsFromFile(struct GAMEUX_STATS *data)
if(SUCCEEDED(hr)) {
hr = IXMLDOMElement_getAttribute(categoryElement, bstrIndex, &vValue);
if( hr == S_OK && V_VT(&vValue) != VT_BSTR)
VARIANT categoryIndex, categoryName;
hr = IXMLDOMElement_getAttribute(categoryElement, bstrIndex, &categoryIndex);
if( hr == S_OK && V_VT(&categoryIndex) != VT_BSTR) hr = E_FAIL; if(SUCCEEDED(hr)) {
i = StrToIntW(V_BSTR(&vValue));
hr = IXMLDOMElement_getAttribute(categoryElement, bstrName, &vValue);
if( hr == S_OK && V_VT(&vValue) != VT_BSTR)
i = StrToIntW(V_BSTR(&categoryIndex));
hr = IXMLDOMElement_getAttribute(categoryElement, bstrName, &categoryName);
if( hr == S_OK && V_VT(&categoryName) != VT_BSTR) hr = E_FAIL; }
VariantClear(&categoryIndex);
You should only clear it when it has been successfully set.