diff --git a/sorting/merge_sort.c b/sorting/merge_sort.c index bd317ec9..c61767a1 100644 --- a/sorting/merge_sort.c +++ b/sorting/merge_sort.c @@ -68,7 +68,7 @@ void merge(int *a, int l, int r, int n) } } - for (c = l; c < r - l + 1; c++) a[c] = b[c]; + for (c = l; c < r + 1; c++) a[c] = b[c]; free(b); }