forked from auracaster/openocd
openocd: use macro ARRAY_SIZE()
There are still few cases where the macro ARRAY_SIZE() should be used in place of custom code. Use ARRAY_SIZE() whenever possible. Change-Id: Iba0127a02357bc704fe639e08562a4f9aa7011df Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6260 Reviewed-by: Xiang W <wxjstz@126.com> Tested-by: jenkins
This commit is contained in:
@@ -314,7 +314,7 @@ static int nuttx_update_threads(struct rtos *rtos)
|
||||
|
||||
state = tcb.dat[state_offset - 8];
|
||||
thread->extra_info_str = NULL;
|
||||
if (state < sizeof(task_state_str)/sizeof(char *)) {
|
||||
if (state < ARRAY_SIZE(task_state_str)) {
|
||||
thread->extra_info_str = malloc(256);
|
||||
snprintf(thread->extra_info_str, 256, "pid:%d, %s",
|
||||
tcb.dat[pid_offset - 8] |
|
||||
|
||||
Reference in New Issue
Block a user