Fixed error: Syscall param write(buf) points to uninitialised byte(s)
[SXSI/XMLTree.git] / libcds / src / static_sequence / static_sequence_wvtree.cpp
index ceeb732..5f958cd 100644 (file)
@@ -22,6 +22,7 @@
 #include <static_sequence_wvtree.h>
 
 static_sequence_wvtree::static_sequence_wvtree(uint * symbols, uint n, wt_coder * c, static_bitsequence_builder * bmb, alphabet_mapper * am) {
+    this->n = n;
   for(uint i=0;i<n;i++) 
     symbols[i] = am->map(symbols[i]);
   this->am = am;
@@ -34,6 +35,7 @@ static_sequence_wvtree::static_sequence_wvtree(uint * symbols, uint n, wt_coder
 }
 
 static_sequence_wvtree::static_sequence_wvtree(uchar * symbols, uint n, wt_coder * c, static_bitsequence_builder * bmb, alphabet_mapper * am) {
+    this->n = n;
   for(uint i=0;i<n;i++) 
     symbols[i] = (uchar)am->map((uint)symbols[i]);
   this->am = am;
@@ -66,7 +68,7 @@ uint static_sequence_wvtree::rank(uint symbol, uint pos) {
 uint static_sequence_wvtree::rankLessThan(uint &symbol, uint pos) {
     uint s = am->map(symbol);
 //    std::cout << "lessthan..." << std::endl;
-    uint r = root->rankLessThan(s, pos, 0, c);
+    uint r = root->rankLessThan(s, pos);
     symbol = am->unmap(s);
     return r;
 }