diff options
author | Peng Wu <alexepico@gmail.com> | 2012-02-29 13:31:28 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2012-02-29 13:31:28 +0800 |
commit | 20acf51bad185665f9ef1ab4c46399befe93b28a (patch) | |
tree | 65954bc24602b5f177755f2b55e0fa2c3ab4eda6 /src/storage/ngram.cpp | |
parent | ddaa170880aea10e5a08e71dfdde7b7cf57d18c1 (diff) | |
download | libpinyin-20acf51bad185665f9ef1ab4c46399befe93b28a.tar.gz libpinyin-20acf51bad185665f9ef1ab4c46399befe93b28a.tar.xz libpinyin-20acf51bad185665f9ef1ab4c46399befe93b28a.zip |
add safe guard
Diffstat (limited to 'src/storage/ngram.cpp')
-rw-r--r-- | src/storage/ngram.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/storage/ngram.cpp b/src/storage/ngram.cpp index c05eb6b..dbb9267 100644 --- a/src/storage/ngram.cpp +++ b/src/storage/ngram.cpp @@ -443,12 +443,12 @@ bool merge_single_gram(SingleGram * merged, const SingleGram * system, merged_chunk.set_content(0, &merged_total, sizeof(guint32)); const SingleGramItem * cur_system = (const SingleGramItem *) - ((const char *)(system->m_chunk.begin()) + sizeof(guint32)); + (((const char *)(system->m_chunk.begin())) + sizeof(guint32)); const SingleGramItem * system_end = (const SingleGramItem *) system->m_chunk.end(); const SingleGramItem * cur_user = (const SingleGramItem *) - ((const char *)(user->m_chunk.begin()) + sizeof(guint32)); + (((const char *)(user->m_chunk.begin())) + sizeof(guint32)); const SingleGramItem * user_end = (const SingleGramItem *) user->m_chunk.end(); |