text.c: use strncpy instead of strcpy for better security