Skip to content

Commit

Permalink
Do not use strcpy to copy 2 char
Browse files Browse the repository at this point in the history
Given `char src` and `char dst`,
one should copy them like `dst = src`,
not like `strcpy(&dst, &src)`.

Fixes rapidsai#847.
  • Loading branch information
mhoemmen committed Sep 27, 2022
1 parent 1dd2feb commit 694deda
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions cpp/include/raft/linalg/detail/svd.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,9 @@ void svdQR(const raft::handle_t& handle,
char jobu = 'S';
char jobvt = 'A';

if (!gen_left_vec) {
char new_u = 'N';
strcpy(&jobu, &new_u);
}
if (!gen_left_vec) { jobu = 'N'; }

if (!gen_right_vec) {
char new_vt = 'N';
strcpy(&jobvt, &new_vt);
}
if (!gen_right_vec) { jobvt = 'N'; }

RAFT_CUSOLVER_TRY(cusolverDngesvd(cusolverH,
jobu,
Expand Down

0 comments on commit 694deda

Please sign in to comment.