fixed copy function

I mistook the variables inside the loop and it caused really weird behaviour
This commit is contained in:
AustrianToast 2024-10-07 09:03:01 +02:00
parent 9929a4470c
commit 6ab823c1fc
Signed by: AustrianToast
GPG Key ID: 174D780E041684FF

View File

@ -78,9 +78,8 @@ int read_csv(const char *file_name, const uint64_t row_length, const uint64_t co
}
void copy(const uint64_t row_length, const uint64_t column_length, const uint64_t input_matrix[row_length][column_length], uint64_t output_matrix[row_length][column_length]) {
// loop should technically not be needed, but I cannot figure out the required size of __n.
for (uint64_t row_index = 0; row_index < row_length; row_index++) {
for (uint64_t column_index = 0; column_index <column_length; column_index++) {
output_matrix[row_index][column_length] = input_matrix[row_index][column_index];
}
memcpy(output_matrix[row_index], input_matrix[row_index], sizeof(output_matrix[row_index]));
}
}