So, u cannot do:
{
...
char* foo = strstr(nodeAux.getNodeValue().transcode(),
SEARCHSTRING);
...
}
without dumping memory, don't u?
I think this is a bit messy, since many times I'll use the transcoded string
only once, and there is no need of getting a permanent pointer for further
use.
Isn't the char buffer returned by transcode() deleted when it comes out
of scope?, (like char arrays do).
Jorge.
> hi,
>
> > main
> > {
> > char foo[BUF_SIZE];
> > strcpy(foo, textNode.getNodeValue().transcode());
>
> ^^^^^^^^^^^^^^ generating memory hole here
>
> > trim (foo);
> > }
>
> from the DOM_Strin.transcode() doc:
>
> -------------------
>
> char * DOMString::transcode ( ) const
>
> Returns a copy of the string, transcoded to the local code page.
>
> The caller owns the (char *) string that is returned, and is responsible
for deleting it.
>
> Returns:
> A pointer to a newly allocated buffer of char elements, which represents
the original string, but in the local encoding.
>
> -------------------
>
> regards
> stefan
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
> ****************************************************************
> Este mensaje ha sido analizado con una herramienta
> de deteccion de virus para su seguridad.
> Ministerio de Justicia
> ***************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]