aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTomas Vanek <vanekt@fbl.cz>2018-08-05 17:16:01 +0200
committerTomas Vanek <vanekt@fbl.cz>2018-08-21 19:26:26 +0100
commit704d7ac2d0551514b81650addd76e35327c7beb0 (patch)
treec9d5910fa42b21a0ac1c0d05d2ec315b7ba1f38d /src
parent6ec5fe8269fc1b28531c734071f8dd5abf984b46 (diff)
downloadriscv-openocd-704d7ac2d0551514b81650addd76e35327c7beb0.zip
riscv-openocd-704d7ac2d0551514b81650addd76e35327c7beb0.tar.gz
riscv-openocd-704d7ac2d0551514b81650addd76e35327c7beb0.tar.bz2
rtos/linux.c: fix clang static analyzer warning
Remove sizeof(int64_t) from string size computation. Change-Id: I029b394df5d62a2594a723c4c0e13608b3423b9b Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/4640 Tested-by: jenkins
Diffstat (limited to 'src')
-rw-r--r--src/rtos/linux.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rtos/linux.c b/src/rtos/linux.c
index 3b2a2b0..4529ddb 100644
--- a/src/rtos/linux.c
+++ b/src/rtos/linux.c
@@ -1134,7 +1134,7 @@ int linux_gdb_thread_packet(struct target *target,
if (retval != ERROR_OK)
return ERROR_TARGET_FAILURE;
- char *out_str = calloc(1, 350 * sizeof(int64_t));
+ char *out_str = calloc(MAX_THREADS * 17 + 10, 1);
char *tmp_str = out_str;
tmp_str += sprintf(tmp_str, "m");
struct threads *temp = linux_os->thread_list;
@@ -1171,7 +1171,7 @@ int linux_gdb_thread_update(struct target *target,
if (found == 1) {
/*LOG_INFO("INTO GDB THREAD UPDATE FOUNDING START TASK");*/
- char *out_strr = calloc(1, 350 * sizeof(int64_t));
+ char *out_strr = calloc(MAX_THREADS * 17 + 10, 1);
char *tmp_strr = out_strr;
tmp_strr += sprintf(tmp_strr, "m");
/*LOG_INFO("CHAR MALLOC & M DONE");*/