@Capehill
Quote:
Anyway, check that "str" is a valid pointer before strncpy.
Yep. That could be a problem if it's NULL.
Quote:
Also If "str" points to a string that is longer than 1023 characters, there will not be NUL termination.
That's a good reason to switch to more modern "strlcpy". It always terminates the copy with a NULL.
Maybe something like:
strlcpy(lied.phonolithprojekt, str, sizeof(lied.phonolithprojekt)); (
https://linux.die.net/man/3/strlcpy)
Since "lied.phonolithprojekt" appears in a number of program files, it might be a good idea to initialize it in the structure declaration with something like "unnamed project".