summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2015-06-02 15:57:27 +0800
committerPeng Wu <alexepico@gmail.com>2015-06-02 15:57:27 +0800
commit5cdd5675d09a10a515d8cfc5cf39ab825751339e (patch)
treee5cb2c68346683cca1c6b30b24e928cdaf5ed99c
parent3c73a79a04c17b725b4ea272a594afa069394e97 (diff)
downloadlibpinyin-5cdd5675d09a10a515d8cfc5cf39ab825751339e.tar.gz
libpinyin-5cdd5675d09a10a515d8cfc5cf39ab825751339e.tar.xz
libpinyin-5cdd5675d09a10a515d8cfc5cf39ab825751339e.zip
re-factor code
-rw-r--r--src/storage/table_info.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/storage/table_info.cpp b/src/storage/table_info.cpp
index ff499b3..f496c7a 100644
--- a/src/storage/table_info.cpp
+++ b/src/storage/table_info.cpp
@@ -194,10 +194,9 @@ bool SystemTableInfo2::load(const char * filename) {
}
TABLE_PHONETIC_TYPE type = PINYIN_TABLE;
- char * str = NULL;
- num = fscanf(input, "source table format:%ms", &str);
+ char str[256];
+ num = fscanf(input, "source table format:%256s", str);
type = to_table_phonetic_type(str);
- free(str);
#if 0
printf("binver:%d modelver:%d lambda:%f\n", binver, modelver, lambda);