Skip to content

Commit

Permalink
Simplify byte size calculation
Browse files Browse the repository at this point in the history
Co-authored-by: Ronan Keryell <ronan.keryell@amd.com>
  • Loading branch information
MathiasMagnus and keryell authored Nov 7, 2023
1 parent 582ddd5 commit da37358
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/Utils/File.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ char *cl_util_read_exe_relative_text_file(const char *const rel_path,
cl_int err = CL_SUCCESS;
size_t exe_folder_length;
OCLERROR_RET(cl_util_executable_folder(NULL, &exe_folder_length), err, end);
MEM_CHECK(abs_path = (char *)malloc(sizeof(char) * exe_folder_length
MEM_CHECK(abs_path = (char *)malloc(exe_folder_length
+ strlen(rel_path) + 1),
err, end);
OCLERROR_RET(cl_util_executable_folder(abs_path, NULL), err, end);
Expand Down

0 comments on commit da37358

Please sign in to comment.