If wont to copy a string, I normally use
char *strdup(char *)
Because it bundles malloc() and strcpy()
there is also strndup() if you only need a part of a text string, might not be included older C standard lib's.
sprintf is best used for converting or formatting a text.
as for sprintf being unsafe, its only unsafe if don't calculate required buffer size in advanced, and use malloc to create a buffer.
Sure snprintf is safer, but it might be tiny bit slower, because it checks for if at end of buffer.
static buffer like
char mybuffer[33]; might really unsafe, imaging using this for file names, as old FFS files was only 32 chars, it was not a problem, but then newer versions of file systems started to support 128 char names.
It important to know etch function has It's own use, and don't try to make assumptions.
There is also
salloc()
The cool thing about it is that it allocates memory on the stack, so when exit a function, you get memory back with out freeing it, the disadvantage is that stack is predefined on AmigaOS and can't be auto increased, while program is running. so running out stack memory can be real issue.
maybe better to stick to malloc().
There are also AllovVec() and AllocMem() in Exec.library, this most not be mixed with malloc(), and free().