You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by Jean-Yves Baudy <jy...@free.fr> on 2004/03/29 18:21:18 UTC

[Help] strdup function and Visual C++ 6

Hi all,

We are having a problem with strdup (only used in SoapDeSerializer.cpp) 
with Visual C++ 6.

When generating a C client with a complexType that define xsd:string 
elements if call Axis_Delete_MyCplxType(myCplxObj,0,0) we have strange 
message from Visual C++ 6 (heap violation).

To success we have replaced strdup whith axis_strdup

char *axis_strdup(const char *s) {
    register char *p = (char *)malloc(strlen(s)+1);
     if (p != NULL)
       strcpy(p, s);
        return p;
}

We are not very familiar with C. Have you got an idea of why strdup fail 
with  Visual C++ 6 ?

Regards,

Jean-Yves