summaryrefslogtreecommitdiffstats
path: root/src/storage/ngram_kyotodb.cpp
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2015-04-17 14:53:23 +0800
committerPeng Wu <alexepico@gmail.com>2015-04-17 14:53:23 +0800
commit01aed1f2efffa461e24d3bacdf0d499456b81ce6 (patch)
tree399c3832cb073adecd4528f16d1e97a6cefe142c /src/storage/ngram_kyotodb.cpp
parent87c1f5002150f24a45bf0b33f4fa0b7de44aaa2e (diff)
downloadlibpinyin-01aed1f2efffa461e24d3bacdf0d499456b81ce6.tar.gz
libpinyin-01aed1f2efffa461e24d3bacdf0d499456b81ce6.tar.xz
libpinyin-01aed1f2efffa461e24d3bacdf0d499456b81ce6.zip
fixes typos
Diffstat (limited to 'src/storage/ngram_kyotodb.cpp')
-rw-r--r--src/storage/ngram_kyotodb.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/storage/ngram_kyotodb.cpp b/src/storage/ngram_kyotodb.cpp
index 1cb72f4..f2771ca 100644
--- a/src/storage/ngram_kyotodb.cpp
+++ b/src/storage/ngram_kyotodb.cpp
@@ -141,6 +141,9 @@ bool Bigram::load(phrase_token_t index, SingleGram * & single_gram){
const char * kbuf = (char *) &index;
const int32_t vsiz = m_db->check(kbuf, sizeof(phrase_token_t));
+ /* -1 on failure. */
+ if (-1 == vsiz)
+ return false;
m_chunk.set_size(vsiz);
char * vbuf = (char *) m_chunk.begin();