summaryrefslogtreecommitdiffstats
path: root/tests/lookup/test_simple_lookup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lookup/test_simple_lookup.cpp')
-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)