From 244e05181398ecc7f70dbadb7a4467727354d8c6 Mon Sep 17 00:00:00 2001 From: nvalimak Date: Tue, 21 Apr 2009 07:58:44 +0000 Subject: [PATCH] Fixed error: Syscall param write(buf) points to uninitialised byte(s) git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/XMLTree@342 3cdefd35-fc62-479d-8e8d-bae585ffb9ca --- libcds/src/static_sequence/static_sequence_wvtree.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libcds/src/static_sequence/static_sequence_wvtree.cpp b/libcds/src/static_sequence/static_sequence_wvtree.cpp index b4a6298..5030fb1 100644 --- a/libcds/src/static_sequence/static_sequence_wvtree.cpp +++ b/libcds/src/static_sequence/static_sequence_wvtree.cpp @@ -22,6 +22,7 @@ #include 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;imap(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;imap((uint)symbols[i]); this->am = am; @@ -124,12 +126,17 @@ uint static_sequence_wvtree::size() { uint static_sequence_wvtree::save(FILE * fp) { uint wr = WVTREE_HDR; wr = fwrite(&wr,sizeof(uint),1,fp); + fflush(fp); if(wr!=1) return 1; wr = fwrite(&n,sizeof(uint),1,fp); + fflush(fp); if(wr!=1) return 1; if(c->save(fp)) return 1; + fflush(fp); if(am->save(fp)) return 1; + fflush(fp); if(root->save(fp)) return 1; + fflush(fp); return 0; } -- 2.17.1