don't return .c_str() without copying it first
authorkim <kim@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Mon, 2 Mar 2009 00:54:24 +0000 (00:54 +0000)
committerkim <kim@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Mon, 2 Mar 2009 00:54:24 +0000 (00:54 +0000)
git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/XMLTree@193 3cdefd35-fc62-479d-8e8d-bae585ffb9ca

XMLTree.h
makefile

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
index 1b3dc58..4f06f3b 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,4 +1,4 @@
-FLAGS = -O3 -I./libcds/includes/\r
+FLAGS =-std=c++0x -O3 -I./libcds/includes/\r
 \r
 OBJECTS=libcds/lib/libcds.a\r
 OBJECTS_TC= TextCollection/TextCollection.o TextCollection/CSA.o TextCollection/Tools.o TextCollection/BitRank.o TextCollection/bittree.o TextCollection/rbtree.o TextCollection/dynFMI.o TextCollection/RLWaveletTree.o TextCollection/GapEncode.o TextCollection/BSGAP.o\r