search sprintf and replace with snprintf

Hi,

anyone knows the perl search-and-replace expression for

strcpy (char * destination, const char * source ); to
strncpy ( char * destination, const char * source, size_t num ); ?

the first and second arguments are the same (destination and source), the difference being that strncpy has an additional third argument, sizeof(destination)

thanks all!

try:

perl -pi -e 's/strcpy\s+\(char\s+\*\s+destination\,\s+const\s+char\s+\*\s+source\s*\)\;/strncpy ( char \* destination, const char \* source, size_t num );/' /foo/bar