Printf prints in the message window and thus must not exceed its buffer size - I believe it's indeed 1024 characters. I have no idea why this was omitted in the manual, but I'll add it.
Using strncpy etc. is up to you. The C library functions are described in all C books. But you must add a header - look into the stdio.h header as an example.