don't return .c_str() without copying it first
[SXSI/XMLTree.git] / XMLTree.h
index d446ab1..c6542a0 100644 (file)
--- a/XMLTree.h
+++ b/XMLTree.h
@@ -401,7 +401,8 @@ public:
    }\r
 \r
    uchar* GetCachedText(DocID d) {\r
-     return (uchar*) (CachedText.at(d).c_str());\r
+     uchar * str = (uchar*) calloc(sizeof(char),(CachedText.at(d).size() + 1));     \r
+     return (uchar*) (str);\r
    }\r
    \r
    TextCollection *getTextCollection() {\r