From 520d7eb21dfb7cbe4a64d2c423655907e861cd30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rex=20Lee=28=E6=9D=8E=E4=BF=8A=29?= Date: Tue, 24 Dec 2013 12:36:24 +0800 Subject: [PATCH] Update pinyin.c --- pinyin/pinyin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pinyin/pinyin.c b/pinyin/pinyin.c index 0ed2024..cf6831b 100644 --- a/pinyin/pinyin.c +++ b/pinyin/pinyin.c @@ -53,7 +53,7 @@ i_HashTable* pinyin_init(){ */ char* pinyin_get(char* cn){ char cnc[3]; - memset(cnc,0,sizeof(char)*); + memset(cnc,0,sizeof(char)*3); strncpy(cnc,cn,2); return (char*)ht_lookup(&dict, cn)->nValue; } @@ -65,4 +65,4 @@ char* pinyin_get(char* cn){ */ void pinyin_destroy(){ ht_release(&dict); -} \ No newline at end of file +}