I wish this helpful for you The characters in the ASCII table assume values that range from 0 to 127, 0 being NULL or '\0', so the condition is always true unless the character is '\0'. *d = 0 places a '\0' at the end of the string; it's how strings are terminated in C. If you don't terminate the string, anything can be printed past the end of the string, and the program has no way to know where it ends. It's undefined behaviour.
Alternative to strcpy? or fix to strcpy in program?
This might help you When you define a pointer like char *name; it points to some random location as you haven't initialized it. It is illegal to write to the pointer and doing so will invoke Undefined Behavior. strcpy basically writes the string to this random pointer location invoking UB.