Fix allocation bug for CachedText
[SXSI/XMLTree.git] / XMLTree.h
index c6542a0..b6aa410 100644 (file)
--- a/XMLTree.h
+++ b/XMLTree.h
@@ -401,7 +401,8 @@ public:
    }\r
 \r
    uchar* GetCachedText(DocID d) {\r
-     uchar * str = (uchar*) calloc(sizeof(char),(CachedText.at(d).size() + 1));     \r
+     uchar * str = (uchar*) calloc(sizeof(char),(CachedText.at(d).size() + 1));\r
+     strcpy((char*) str,(const char*) CachedText.at(d).c_str());\r
      return (uchar*) (str);\r
    }\r
    \r