Is my sorting of linked list CORRECT?

Condition p->next!=NULL (highlighted in RED color) isn't necessary in my code.
Have I done absolutely correct, or I've used extra conditions in the code?

Code: http://libraryofcprograms.blogspot.com/2013/05/sorting-linked-list.html
Topic archived. No new replies allowed.