summaryrefslogtreecommitdiff
path: root/extractor/suffix_array.cc
diff options
context:
space:
mode:
Diffstat (limited to 'extractor/suffix_array.cc')
-rw-r--r--extractor/suffix_array.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/extractor/suffix_array.cc b/extractor/suffix_array.cc
index 9988b1a2..65b2d581 100644
--- a/extractor/suffix_array.cc
+++ b/extractor/suffix_array.cc
@@ -1,5 +1,6 @@
#include "suffix_array.h"
+#include <cassert>
#include <chrono>
#include <iostream>
#include <string>
@@ -186,7 +187,8 @@ shared_ptr<DataArray> SuffixArray::GetData() const {
}
void SuffixArray::WriteBinary(const fs::path& filepath) const {
- FILE* file = fopen(filepath.string().c_str(), "r");
+ FILE* file = fopen(filepath.string().c_str(), "w");
+ assert(file);
data_array->WriteBinary(file);
int size = suffix_array.size();