peiyongz 2004/08/17 14:10:33
Modified: c/src/xercesc/util Base64.hpp Base64.cpp
Log:
fix bug in getting CanRep from decode()
Revision Changes Path
1.11 +2 -2 xml-xerces/c/src/xercesc/util/Base64.hpp
Index: Base64.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Base64.hpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Base64.hpp 11 Aug 2004 16:47:32 -0000 1.10
+++ Base64.hpp 17 Aug 2004 21:10:33 -0000 1.11
@@ -212,7 +212,7 @@
static XMLByte* decode(
const XMLByte* const inputData
, unsigned int* outputLength
- , XMLByte* canRepData
+ , XMLByte*& canRepData
, MemoryManager* const memMgr = 0
, Conformance conform = Conf_RFC2045
);
1.14 +8 -4 xml-xerces/c/src/xercesc/util/Base64.cpp
Index: Base64.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Base64.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- Base64.cpp 11 Aug 2004 16:47:32 -0000 1.13
+++ Base64.cpp 17 Aug 2004 21:10:33 -0000 1.14
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.14 2004/08/17 21:10:33 peiyongz
+ * fix bug in getting CanRep from decode()
+ *
* Revision 1.13 2004/08/11 16:47:32 peiyongz
* Decoding and getCanRep
*
@@ -460,12 +463,13 @@
/***
* Move canonical representation to a XMLCh buffer to return
*/
- XMLCh *canRepData = (XMLCh*) getExternalMemory(memMgr, (decodedLength+1) *
sizeof(XMLCh));
+ unsigned int canRepLen = XMLString::stringLen((char*)canRepInByte);
+ XMLCh *canRepData = (XMLCh*) getExternalMemory(memMgr, (canRepLen + 1) *
sizeof(XMLCh));
- for (unsigned int j = 0; j < decodedLength; j++)
+ for (unsigned int j = 0; j < canRepLen; j++)
canRepData[j] = (XMLCh)canRepInByte[j];
- canRepData[decodedLength] = 0;
+ canRepData[canRepLen] = 0;
/***
* Release the memory allocated in the actual decoding method
@@ -534,7 +538,7 @@
XMLByte* Base64::decode ( const XMLByte* const inputData
, unsigned int* decodedLength
- , XMLByte* canRepData
+ , XMLByte*& canRepData
, MemoryManager* const memMgr
, Conformance conform
)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]