I have this structure:
typedef struct SM_DB
{
LIST_TYPE link;
char name[SM_NAME_SIZE];
} SM_DB_TYPE;
And I
Use:
strcpy(one.name, "Alpha"); //Removed null byte (Read first comment by shf301)
Alternative:
typedef struct SM_DB
{
LIST_TYPE link;
char* name;
} SM_DB_TYPE;
SM_DB_TYPE one;
one.name = malloc(sizeof(char) * (strlen("Alpha") + 1); //Allocate memory
if (!one.name) {
/* Error handling */
} else {
strcpy(one.name, "Alpha");
}