You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by da...@apache.org on 2004/06/22 13:46:16 UTC

cvs commit: ws-axis/c/samples/client/doclitfault AxisDivByZeroException.cpp

damitha     2004/06/22 04:46:16

  Modified:    c/include/axis/server AxisException.h
               c/samples/client/rpcfault AxisDivByZeroException.cpp
               c/samples/client/doclitfault AxisDivByZeroException.cpp
  Log:
  
  
  Revision  Changes    Path
  1.22      +1 -1      ws-axis/c/include/axis/server/AxisException.h
  
  Index: AxisException.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/server/AxisException.h,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- AxisException.h	21 Jun 2004 14:00:41 -0000	1.21
  +++ AxisException.h	22 Jun 2004 11:46:16 -0000	1.22
  @@ -51,7 +51,7 @@
   #define THROW_AXIS_TRANSPORT_EXCEPTION(X) throw AxisTransportException(X)
   #define THROW_AXIS_PARSE_EXCEPTION(X) throw AxisParseException(X)
   
  -#define THROW_AXIS_EXCEPTION2(X, Y) throw AxisException(X)
  +#define THROW_AXIS_EXCEPTION2(X, Y) throw AxisException(X, Y)
   #define THROW_AXIS_CONFIG_EXCEPTION2(X, Y) throw AxisConfigException(X, Y)
   #define THROW_AXIS_SOAP_EXCEPTION2(X, Y) throw AxisSoapException(X, Y)
   #define THROW_AXIS_WSDD_EXCEPTION2(X, Y) throw AxisWsddException(X, Y)
  
  
  
  1.5       +6 -5      ws-axis/c/samples/client/rpcfault/AxisDivByZeroException.cpp
  
  Index: AxisDivByZeroException.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/samples/client/rpcfault/AxisDivByZeroException.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AxisDivByZeroException.cpp	14 Jun 2004 06:25:19 -0000	1.4
  +++ AxisDivByZeroException.cpp	22 Jun 2004 11:46:16 -0000	1.5
  @@ -68,12 +68,13 @@
   void AxisDivByZeroException::processException (DivByZeroStruct* pFault)
   {
   	/*User can do something like deserializing the struct into a string*/
  +
           int iSize = strlen(pFault->varString) + 8;
  -        char* sMessage = (char*) malloc(iSize);
  -        m_sMessage = (char*) malloc(iSize);
  -        char carrTempBuff[4];
  +        char* sMessage = new char[iSize];
  +        m_sMessage = new char[iSize];
  +        char* carrTempBuff =new char[4 * sizeof(char)];
           sprintf(carrTempBuff, "%d", pFault->varInt);
  -        strcat(sMessage, carrTempBuff);
  +        strcpy(sMessage, carrTempBuff);
           strcat(sMessage, "\n");
           sprintf(carrTempBuff, "%f", pFault->varFloat);
           strcat(sMessage, carrTempBuff);
  @@ -81,7 +82,7 @@
           strcat(sMessage, pFault->varString);
           strcat(sMessage, "\n");
           m_sMessage = sMessage;
  -        free(sMessage);
  +        delete(sMessage);
   }
   
   void AxisDivByZeroException::processException(exception* e)
  
  
  
  1.3       +7 -5      ws-axis/c/samples/client/doclitfault/AxisDivByZeroException.cpp
  
  Index: AxisDivByZeroException.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/samples/client/doclitfault/AxisDivByZeroException.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AxisDivByZeroException.cpp	14 Jun 2004 06:25:19 -0000	1.2
  +++ AxisDivByZeroException.cpp	22 Jun 2004 11:46:16 -0000	1.3
  @@ -71,12 +71,13 @@
   void AxisDivByZeroException::processException (DivByZeroFault* pFault)
   {
       /*start user code*/
  +
       int iSize = strlen(pFault->varString) + 8;
  -    char* sMessage = (char*) malloc(iSize);
  -    m_sMessage = (char*) malloc(iSize);
  -    char carrTempBuff[4];
  +    char* sMessage = new char[iSize];
  +    m_sMessage = new char[iSize];
  +    char* carrTempBuff =new char[4 * sizeof(char)];
       sprintf(carrTempBuff, "%d", pFault->varInt);
  -    strcat(sMessage, carrTempBuff);
  +    strcpy(sMessage, carrTempBuff);
       strcat(sMessage, "\n");
       sprintf(carrTempBuff, "%f", pFault->varFloat);
       strcat(sMessage, carrTempBuff);
  @@ -84,7 +85,8 @@
       strcat(sMessage, pFault->varString);
       strcat(sMessage, "\n");
       m_sMessage = sMessage;
  -    free(sMessage);
  +    delete(sMessage);
  +
       /*end user code*/
   }