https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109609
--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> --- strncpy second argument is an array rather than necessarily a string and characters after '\0' are not copied, so if n is non-zero, it reads between 1 and n characters from the source array (not sure if a dumb implementation could try to read all characters and only copy those until '\0' inclusive though).