链表的问题,每次运行都会打印一个随机数,求解答

#include
#include

typedef struct Node
{
int data;
struct Node* next;
}Node, *LinkList;//链表

void InitList(LinkList *L)
{
*L = (LinkList)malloc(sizeof(Node));
(*L)->next = NULL;
}//初始化链表

void CreatFromTail(LinkList L,int c)
{
Node r, *s;
r = L;
s = (Node
)malloc(sizeof(Node));
s->data = c;
r->next = s;
r = s;
}//建立链表

int main()
{
LinkList total;
InitList(&total);
CreatFromTail(total, 1);
printf("%d", total->data);
return 0;
}

 #include<stdio.h>
#include<stdlib.h>

typedef struct Node
{
     int data;
     struct Node* next;
}Node, *LinkList;//链表 

void InitList(LinkList *L)
{
    *L = (LinkList)malloc(sizeof(Node));
    (*L)->next = NULL;
}//初始化链表 

void CreatFromTail(LinkList L,int c)
{
    Node *r, *s;
    r = L;
    s = (Node*)malloc(sizeof(Node));
    s->data = c;
    r->next = s; 
    r = s;
}//建立链表

int main()
{
    LinkList total;
    InitList(&total);
    CreatFromTail(total, 1);
    printf("%d", total->next->data);
    return 0; 
}
你total->data事实上没有初始化也没有赋值,你赋值在s上,也就是total->next上