diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 5b78435c..3f1a1405 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -8,6 +8,9 @@ * src/cmd/cmd_shell.c (cmd_shell_run): Log non-zero shell exit status. + * src/cmd/cmd_pod.c (cmd_pod_run), src/cmd/cmd_shell.c (cmd_shell_run): + Fix size_t handling with strlen. + 2010-01-21 Jie Zhang * src/apps/jtag/jtag.c (main): Don't trigger open file error diff --git a/urjtag/src/cmd/cmd_pod.c b/urjtag/src/cmd/cmd_pod.c index 73ad6e42..ac472265 100644 --- a/urjtag/src/cmd/cmd_pod.c +++ b/urjtag/src/cmd/cmd_pod.c @@ -68,7 +68,7 @@ cmd_pod_run (urj_chain_t *chain, char *params[]) } urj_pod_sigsel_t it = URJ_POD_CS_NONE; - int n = strlen (params[j]); + size_t n = strlen (params[j]); if (n > 4 && (strncasecmp (params[j], "tck", 3) == 0)) it = URJ_POD_CS_TCK; diff --git a/urjtag/src/cmd/cmd_shell.c b/urjtag/src/cmd/cmd_shell.c index d608702b..e32d35d0 100644 --- a/urjtag/src/cmd/cmd_shell.c +++ b/urjtag/src/cmd/cmd_shell.c @@ -39,7 +39,8 @@ static int cmd_shell_run (urj_chain_t *chain, char *params[]) { - int i, len, n = urj_cmd_params (params); + int i, n = urj_cmd_params (params); + size_t len; char *shell_cmd; if ((n = urj_cmd_params (params)) == 1) @@ -65,8 +66,8 @@ cmd_shell_run (urj_chain_t *chain, char *params[]) shell_cmd = malloc (len); if (shell_cmd == NULL) { - urj_error_set (URJ_ERROR_OUT_OF_MEMORY, "malloc(%zd) fails", - (size_t) len); + urj_error_set (URJ_ERROR_OUT_OF_MEMORY, "malloc(%zu) fails", + len); return URJ_STATUS_FAIL; }