Ordenamiento de una LISTA DOBLEMENTE ENLAZADA o LIGADA

/* Solo tengo un error :frowning: :mad: HELP! HELP! HELP! .
Alguien que me ayude con eso.
*/

#include <iostream>
#include <cstdlib>
#include <cstring>
#include <fstream>

using namespace std;

struct datos {
int num;
};

struct node {
datos data;
node *left;
node *right;
};

node *newList();
void printListAsc(node *current);

void printNode(node *current);
int size(node * list);

int generador(int min, int max);
void aniadir_ordenador(node **lista, node data);

int main() {
node *head = newList();
node *current = head;

node myData;
for (int i = 0; i &lt; 100; i++) {
    myData.data.num = generador(1, 1000);
    aniadir_ordenador(current, myData); /* SOLO TENGO UN ERROR AQUI */
}
printListAsc(head);
return 0;

}

int size(node * list) {
node *head = list;
node *current = list;
int cont = 0;
while (head != (current = current->right)) {
cont = cont + 1;
}
return cont;
}

void aniadir_ordenador(node **lista, node data) {
node *aux = NULL;
node *ant = NULL;
node *nuevo_dato = NULL;
nuevo_dato = new node;

nuevo_dato-&gt;right = NULL;
nuevo_dato-&gt;left = NULL;

if (*lista == NULL) { //Si la lista esta vacia.
    *lista = nuevo_dato;

}//De lo contrario agrego el nodo ordenado.
aux = *lista;
while (aux != NULL) {
    ant = aux;
    aux = aux-&gt;right;
}
if (ant == NULL) {//un solo elemento.
    nuevo_dato-&gt;right = aux;
    nuevo_dato-&gt;left = aux-&gt;left;
    aux-&gt;left = nuevo_dato;
    *lista = nuevo_dato;

}
if (aux == NULL) { //Ultimo elemento de la lista.
    ant-&gt;right = nuevo_dato;
    nuevo_dato-&gt;left = ant;
    nuevo_dato-&gt;right = aux;

}
//Si no es porque esta en el medio!
nuevo_dato-&gt;right = aux;
aux-&gt;left = nuevo_dato;
nuevo_dato-&gt;left = ant;
ant-&gt;right = nuevo_dato;

}

node * newList() {
node *nuevo;
nuevo = new node;

nuevo-&gt;data.num = -1;
nuevo-&gt;right = nuevo;
nuevo-&gt;left = nuevo;

return nuevo;

}

void printListAsc(node *head) {
node *current = head;

while (current-&gt;right != head) {
    current = current-&gt;right;
    printNode(current);
}

}

void printNode(node *current) {
cout << current->data.num << endl;
}

int generador(int max, int min) {
return rand() % (max - min + 1) + 2;
}