sdDirtySox wrote:

I want to use a perl script that will look at all the files in a
directory to find an instance of a function and replace it with
another. I have the code in place to look at all the files in a
directory and to search line by line, but I'm having problems with the
regex to use.

Example:

sprintf(str, "hello");

replaced with:

sprintf_s(str, sizeof(str), "hello");

You could use the cpp, something like

#define sprintf( fmt, ... ) \
        sprintf_s( (fmt), sizeof(fmt), __VA_ARGS__ )

--
Ruud

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to