Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 35b04e088e |
@@ -7,7 +7,7 @@ struct array *sort(struct array *arr, comparator f)
|
||||
{
|
||||
|
||||
void *temp = malloc(arr->elem_size);
|
||||
|
||||
if (arr->len > 0) {
|
||||
for(size_t index1 = 0; index1 < arr->len - 1; index1 ++ ){
|
||||
|
||||
for(size_t index2 = index1; index2 < arr->len; index2 ++){
|
||||
@@ -22,6 +22,7 @@ struct array *sort(struct array *arr, comparator f)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free(temp);
|
||||
return arr;
|
||||
|
||||
Reference in New Issue
Block a user