Can anybody help me to fix this code? I don't understand much as I'm new to C. I'm using Splint to find security flaws in the code.
char *stringcopy(char *str1, char *str2)
{
while (*str2)
*str1++ = *str2++;
return str2;
}
main(int argc, char **argv)
{
char *buffer = (char *)malloc(16 * sizeof(char));
stringcopy(buffer, argv[1]);
printf("%s\n", buffer);
}