summaryrefslogtreecommitdiffstats
path: root/tests/lookup
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-08-23 18:36:30 +0800
committerPeng Wu <alexepico@gmail.com>2011-08-23 18:36:30 +0800
commit40c82f591553e94f21816b2d940aab1d47f2b3d3 (patch)
tree91653cacc4690ca15a1de77548b5df9e3b3a0eec /tests/lookup
parentc108fa57f1e265a6682c9fdb267e7b2c1653a401 (diff)
downloadlibpinyin-40c82f591553e94f21816b2d940aab1d47f2b3d3.tar.gz
libpinyin-40c82f591553e94f21816b2d940aab1d47f2b3d3.tar.xz
libpinyin-40c82f591553e94f21816b2d940aab1d47f2b3d3.zip
write test pinyin
Diffstat (limited to 'tests/lookup')
-rw-r--r--tests/lookup/test_simple_lookup.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/lookup/test_simple_lookup.cpp b/tests/lookup/test_simple_lookup.cpp
index 96c512a..6a2ebcf 100644
--- a/tests/lookup/test_simple_lookup.cpp
+++ b/tests/lookup/test_simple_lookup.cpp
@@ -52,8 +52,8 @@ int main( int argc, char * argv[]){
PinyinLookup pinyin_lookup(&custom, &largetable, &phrase_index,
&system_bigram, &user_bigram);
- char* linebuf = (char *)malloc ( 1024 * sizeof (char) );
- size_t size = 1024;
+ char* linebuf = NULL;
+ size_t size = 0;
while( getline(&linebuf, &size, stdin) ){
linebuf[strlen(linebuf)-1] = '\0';
if ( strcmp ( linebuf, "quit" ) == 0)