Mercurial > hg > Game > Cerium
changeset 1781:a96cf4e50524 draft
change strcpy to memcpy(but remain strlen)
author | Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 26 Nov 2013 17:46:05 +0900 |
parents | 17c4dc3573b9 |
children | 7245548995a8 |
files | example/string_args/main.cc |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/example/string_args/main.cc Tue Nov 26 17:34:24 2013 +0900 +++ b/example/string_args/main.cc Tue Nov 26 17:46:05 2013 +0900 @@ -50,7 +50,7 @@ //ファイルディスクリプタをそのままタスクに渡してあげる exec->set_inData(0,search_word,search_word_len); - exec->set_param(0,one_task_size); //1つのタスクが読み込む量 + exec->set_param(0,(unsigned long long)one_task_size); //1つのタスクが読み込む量 exec->iterate(task_num); //タスク数分イテレートする } @@ -68,7 +68,8 @@ return -1; } char *sword = (char*)manager->allocate(sizeof(char)*search_word_len); - strcpy(sword,(const char*)search_word); + //strcpy(sword,(const char*)search_word); + memcpy(sword,(const char*)search_word,search_word_len); task_init(); run_start(manager, sword, search_word_len);