- /* Find the midpoint of the list. */
- if (n > 1) {
- for (i = 0, l2 = l1; i < (n+1)/2; i++)
- l2 = l2->next;
- } else if (n == 0) {
- for (i = 0, c = l2 = l1; c; i++, c = c->next) {
- if (i % 2 == 0)
- l2 = l2->next;
- }
-
- n = i;
- }
-
- assert(n != 0);
- if (n == 1) {
- l1->next = NULL;