To all:
My dev PC (WinXP) died tonight, so don't expect frequent
SVN updates until the situation gets resolved.
I've also pulled Oracle access for the time being, pls
tell if it's needed and I try to make it online.
BTW, the patch looks wrong to me as WideToAnsi() isn't
passed any length data, so the conversion will cut the
string at the first zero byte and garbage will be
returned after that point by next hb_itemPutCLPtr()
call. Somehow data length should be pulled from pVariant
structure.
Brgds,
Viktor
On 2009 Sep 23, at 02:25, Antonio Linares wrote:
Proposed change:
case VT_BSTR:
{
char* szString = WideToAnsi( pVariant->n1.n2.n3.bstrVal );
hb_itemPutCLPtr( pItem, szString, WideCharToMultiByte(
CP_ACP, 0, pVariant->n1.n2.n3.bstrVal, -1, NULL, 0, NULL, NULL ) );
break;
}
best regards
Antonio
2009/9/22 Antonio Linares <[email protected]>:
Viktor,
This code in olecore.c (hb_oleVariantToItem()) fails if the string
has
embedded zeroes, as hb_itemPutCPtr() uses strlen() to calculate the
string length.
case VT_BSTR:
{
char* szString = WideToAnsi( pVariant->n1.n2.n3.bstrVal );
hb_itemPutCPtr( pItem, szString );
break;
}
case VT_BSTR | VT_BYREF:
{
char* szString = WideToAnsi( *pVariant->n1.n2.n3.pbstrVal );
hb_itemPutCPtr( pItem, szString );
break;
}
We appreciate your comments, thanks
best regards,
Antonio
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour