summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-07-26 15:26:17 +0800
committerPeng Wu <alexepico@gmail.com>2011-07-26 15:26:17 +0800
commit20817e002894a3897f262938dba393296af10b53 (patch)
treec4502412cedc59a8c0a285f0475766c4d102ad4b /utils
parent8ef85b7328061e215f928346cf0881d2808ad284 (diff)
downloadlibpinyin-20817e002894a3897f262938dba393296af10b53.tar.gz
libpinyin-20817e002894a3897f262938dba393296af10b53.tar.xz
libpinyin-20817e002894a3897f262938dba393296af10b53.zip
fixes stderr fprintf
Diffstat (limited to 'utils')
-rw-r--r--utils/storage/gen_binary_files.cpp8
-rw-r--r--utils/storage/gen_pinyin_table.cpp5
2 files changed, 7 insertions, 6 deletions
diff --git a/utils/storage/gen_binary_files.cpp b/utils/storage/gen_binary_files.cpp
index f8d3c70..5d32b58 100644
--- a/utils/storage/gen_binary_files.cpp
+++ b/utils/storage/gen_binary_files.cpp
@@ -30,7 +30,7 @@ int main(int argc, char * argv[]){
FILE * gbfile = fopen("../../data/gb_char.table", "r");
if ( gbfile == NULL) {
- printf("open gb_char.table failed!");
+ fprintf(stderr, "open gb_char.table failed!");
return 1;
}
@@ -42,7 +42,7 @@ int main(int argc, char * argv[]){
FILE * gbkfile = fopen("../../data/gbk_char.table","r");
if ( gbkfile == NULL) {
- printf("open gb_char.table failed!");
+ fprintf(stderr, "open gb_char.table failed!");
return 1;
}
@@ -67,7 +67,7 @@ int main(int argc, char * argv[]){
FILE* infile = fopen("../../data/gb_char.table", "r");
if ( NULL == infile ){
- printf("open gb_char.table failed!\n");
+ fprintf(stderr, "open gb_char.table failed!\n");
exit(ENOENT);
}
@@ -76,7 +76,7 @@ int main(int argc, char * argv[]){
infile = fopen("../../data/gbk_char.table", "r");
if ( NULL == infile ){
- printf("open gbk_char.table failed!\n");
+ fprintf(stderr, "open gbk_char.table failed!\n");
exit(ENOENT);
}
diff --git a/utils/storage/gen_pinyin_table.cpp b/utils/storage/gen_pinyin_table.cpp
index 1808162..149e492 100644
--- a/utils/storage/gen_pinyin_table.cpp
+++ b/utils/storage/gen_pinyin_table.cpp
@@ -138,7 +138,8 @@ void feed_line (const char * phrase, const char * pinyin, const guint32 freq){
* where is the code which I don't want to touch. :-)
*/
if (new_phrase_ptr->length >= MAX_PHRASE_LENGTH ) {
- printf("too long phrase:%s\t%s\t%d\n", phrase, pinyin, freq);
+ fprintf(stderr, "too long phrase:%s\t%s\t%d\n", phrase,
+ pinyin, freq);
free(new_phrase_ptr);
return;
}
@@ -160,7 +161,7 @@ void feed_line (const char * phrase, const char * pinyin, const guint32 freq){
value_item.freq = freq;
if(new_phrase_ptr->length != value_item.pinyin->len){
- printf("error:phrase:%s\tpinyin:%s\n", phrase, pinyin);
+ fprintf(stderr, "error:phrase:%s\tpinyin:%s\n", phrase, pinyin);
return;
}