Hello there, I am having a problem with small application. I have used gdb and following error appeared:
strlen() segmentation fault. Could anyone help me to find out solution?
int main(int argc, char* argv[]){
char* name = malloc(strlen(argv[1]));
name = strcpy(name, argv[1]);
printf("%s \n", name);
return EXIT_SUCCESS;
}