When I print the linked list countryName value always stay with the last string.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct usa_primaries * ptr;
typedef struct primariesDate{
    int month;
    int day;
    int hour;
}primariesDate;
 typedef struct usa_primaries{
primariesDate date;
char *countryName;
int isOpen;
ptr next;
}usa_primaries;
void add (int month, int day, int hour, char *country, int isOpen, ptr *head) {
    ptr t;
    t = (ptr) malloc(sizeof(usa_primaries));
    t->date.month = month;
    t->date.day = day;
    t->date.hour = hour;
    t->countryName = (char *)  malloc(strlen(country)+1);
    strcpy(t->countryName, country);
    t->isOpen = isOpen;
    if(!(*head)) {
        t->next = NULL;
        *head = t;
    }
    else {
        t->next = *head;
        *head = t;
    }
Below is the main function, I'm trying to print only countryName details but what I see is only the last value that is inserted. for example: scanf: test1, test2 the output is: test2 test2
int main() {
    ptr head = NULL;
    int month, day, hour, isopen;
    char country[20];
    while (scanf("%d %d %d %s %d", &month, &day, &hour, country, &isopen) != EOF) {
        add(month, day, hour, country, isopen, &head);
    }
    ptr print = head;
    while (print) {
        printf("\n %s ", head->countryName);
        print = print->next;
    }
    free(head);
    return 0;
}
