I have the following code that will copy the argument string into a char array.
char *str = malloc(strlen(argv[1]) + 1); strcpy(str, argv[1]); printf("%s\n", str);
Why, when I pass the following argument:
$6$4MfvmFOaDUaa5bfr$cvtrefr
I get:
MfvmFOaDUaa5bfr
Instead of a whole line. Somewhere I'm losing the first number. I tried various methods and each of them works the same or does not work.
My key only gets salt (in this case) 4MfvmFOaDUaa5bfr or $6$4MfvmFOaDUaa5bfr without the third character $. I am also trying to get a method for copying a string when I meet the third $, and then stop copying.
c arrays linux copy
adm
source share