mirror of
https://github.com/Lurkki14/tuxclocker.git
synced 2024-11-24 09:10:16 -06:00
fix index in tc_str_arr_dup
This commit is contained in:
parent
42421e11e6
commit
f8d0dbb7b8
@ -3,11 +3,18 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
char **tc_str_arr_dup(int8_t str_count, char **const strings) {
|
||||
char **tc_str_arr_dup(uint16_t str_count, char **const strings) {
|
||||
char **ptr_arr = calloc(str_count, sizeof(char*));
|
||||
for (int8_t i = 0; i < str_count; i++) {
|
||||
for (uint16_t i = 0; i < str_count; i++) {
|
||||
ptr_arr[i] = strdup(strings[i]);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return ptr_arr;
|
||||
}
|
||||
|
||||
void tc_str_arr_free(uint16_t str_count, char **strings) {
|
||||
for (uint16_t i = 0; i < str_count; i++) {
|
||||
free(strings[i]);
|
||||
}
|
||||
free(strings);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user