From: stewartamiles Date: Thu, 23 Jul 2009 16:33:33 +0000 (+0000) Subject: Fixed cmockery "Issue 9: assert_macro.c" X-Git-Tag: cmocka-1.1.1~371 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5cb1a7d04547f26bfd3ce7b4faf6a35ae0d7cdfe;p=platform%2Fupstream%2Fcmocka.git Fixed cmockery "Issue 9: assert_macro.c" Reported by khb.hnu, Apr 12, 2009 Line30: for (i = 0; i < sizeof(status_code_string) / sizeof(status_code_string[0]); change it as follow: for (i = 0; i < sizeof(status_code_strings) / sizeof(status_code_strings[0]); git-svn-id: http://cmockery.googlecode.com/svn/trunk@33 40f4469a-5155-0410-be90-2de3f0bae501 --- diff --git a/doc/index.html b/doc/index.html index 45554da..a4b897f 100644 --- a/doc/index.html +++ b/doc/index.html @@ -227,8 +227,8 @@ const char* get_status_code_string(const unsigned int status_code) { unsigned int string_to_status_code(const char* const status_code_string) { unsigned int i; - for (i = 0; i < sizeof(status_code_string) / sizeof(status_code_string[0]); - i++) { + for (i = 0; i < sizeof(status_code_strings) / + sizeof(status_code_strings[0]); i++) { if (strcmp(status_code_strings[i], status_code_string) == 0) { return i; } @@ -714,5 +714,5 @@ are provided as an example of Cmockery's features discussed in this document.
- Last modified: Tue Aug 26 09:33:31 PDT 2008 + Last modified: Mon Jul 6 12:21:30 PDT 2009 diff --git a/src/example/assert_macro.c b/src/example/assert_macro.c index aadcac3..bcd6e78 100644 --- a/src/example/assert_macro.c +++ b/src/example/assert_macro.c @@ -27,8 +27,8 @@ const char* get_status_code_string(const unsigned int status_code) { unsigned int string_to_status_code(const char* const status_code_string) { unsigned int i; - for (i = 0; i < sizeof(status_code_string) / sizeof(status_code_string[0]); - i++) { + for (i = 0; i < sizeof(status_code_strings) / + sizeof(status_code_strings[0]); i++) { if (strcmp(status_code_strings[i], status_code_string) == 0) { return i; }