質問です。
struct list {
 int key;          /* キー */
 char name[20];     /* 名前 */
 struct list *next;    /* 次のデータへのポインタ */
};

struct list *add_list(int key, char *name, struct list *head)
{
 struct list *prev, *cur;
 struct list *p = malloc(sizeof *p);

 if (p == NULL) { printf("out of memory\n"); exit(1); }
 p->key = key;
 strcpy(p->name, name);
 p->next = NULL;

 if (head == NULL || strcmp(name, head->name) < 0) {
   p->next = head;
   return p;
 }
 for (prev = cur = head; (cur = cur->next) != NULL; prev = cur) {
   if (strcmp(name, cur->name) < 0) {
     p->next = cur;
     break;
   }
 }
 prev->next = p;
 return head;
}