While I know that linked lists seem to be a fairly common problem area among beginner C programmers, most examples that I have come across abstract the sorting of a linked list to a separate function which is sadly not what I am trying to do.

The code below is my attempt to have the nodes inserted into their correct place so that once all nodes have been inserted they are already in a sorted order.

Code:
int main(int argc, char *argv[])
{
    struct node_t* dict_head;
    struct node_t* traversor;
    struct node_t* newnode;


    int list_size = 0, insert_key, search_key, delete_key, x;
    char insert_word[WORDLEN];
    
    
    /*Opening the dictionary file provided by the command line argument */
    FILE *fp;
    fp = fopen(argv[1], "r");


    dict_head = malloc(sizeof(struct node_t));
    assert(dict_head != NULL);
    traversor = malloc(sizeof(struct node_t));
    assert(dict_head != NULL); 
    
    while(fscanf(fp,"%d %s\n", &traversor->key, traversor->word) == 2){
        newnode =  malloc(sizeof(struct node_t));
        newnode->key = traversor->key;
        strcpy(newnode->word, traversor->word);
        traversor = dict_head;
        
        while(traversor->next!= NULL){
            
            if(traversor->next->key > newnode->key){break;}
            
            traversor = traversor->next;
        }
        printf("Traversor is sitting on %s\n", traversor->word);
        newnode->next = traversor->next;
        traversor->next = newnode;
        traversor = dict_head;
        for(x = 0; x < list_size; x++)
        {
            printf("%d %s %d ->", traversor, traversor->word, traversor->key);
            traversor = traversor->next;
        }
        printf("%d %s %d",traversor->next, traversor->next->word, traversor->next->key);
        
        printf("\n");
        list_size++;
    }
    
    return 0;
}
with node_t being
Code:
struct node_t{
    int key;
    char word[WORDLEN];
    struct node_t *next;
};

The problem is as follows. When you provide it with input in which the first word scanned is any other word than that which would be placed at the front of the list, it works as intended. For example.

7 world
0 ant
3 kodak
1 best
6 the
2 is

Produces ant -> best->is->kodak->best->world

However, swapping ant and world in the above input gives:
world->best->is->kodak->best->world


In regards to why I have my head node set as a node without a word or a key, it was suggested that I make it so that the first node inserted is set to be the head of the list and then changed as sorting required, yet this caused only additional problems.

Any help that can be given would be greatly appreciated