The following code snippet is not working right.

```
void deleteNode(list **start, int pos) {
    int currentPosition=0;
    list *currentNode;
    list *nodToDelete;

    currentNode = *start;
    if (currentNode == NULL) {
        printf("Empty List\n");
    } else if (pos == 0 ) {
        nodToDelete = *start;
        *start = nodToDelete->next;
        free(nodToDelete);
    } else {
        while (currentNode->next != NULL) {
            if (currentPosition >= pos -1) {
                break;
            }
            currentPosition++;
            currentNode = currentNode->next;
        }
        if (currentPosition < pos -1 || currentNode->next == NULL) {
            printf("No node at given position exists\n");
        } else {
            nodToDelete = currentNode->next;
            currentNode = nodToDelete->next;
            free(nodToDelete);
            nodToDelete = NULL;
        }
    }
}

void displayList(list *node) {
    if (node == NULL) {
        printf("Empty List");
    }

    while (node != NULL) {
        printf("%d\t", node->data);
        node = node->next;
    }
    printf("\n");
}

int main()
{
    list *start, *node;
    start = NULL;

    insertNode(&start, 2);
    insertNode(&start, 3);
    insertNode(&start, 4);
    insertNode(&start, 1);
    insertNode(&start, 5);

    deleteNode(&start, 3);

    displayList(start);
}

```

When executed the output is 

> 
> Before Deletion 2 3 4 1 5  
> 
>  After Deletion 2 3 4 0 5
> 
> 
> 

It is supposed to delete 1 but it is inserting 0 at its place.