B
Ben Bacarisse
I am porting a program from the Windows world to the Linux world. The
source uses MS's new "safer" string functions such as:
strcat_s(dest, size, source);
but there are also calls such as:
strcat_s(dest, source);
I gather that the MS C++ library includes a option whereby some
function template magic converts that to:
strcat_s(dest, sizeof dest, source);
in the case where dest is an array (of char).
Can I get such a library for gcc or, failing that, what is the magic
that turns the two-arg form into the three-arg one? Writing strcat_s
(and strcpy_s which is also used) is not hard, and I would prefer a
solution that lets me leave the original source untouched.
source uses MS's new "safer" string functions such as:
strcat_s(dest, size, source);
but there are also calls such as:
strcat_s(dest, source);
I gather that the MS C++ library includes a option whereby some
function template magic converts that to:
strcat_s(dest, sizeof dest, source);
in the case where dest is an array (of char).
Can I get such a library for gcc or, failing that, what is the magic
that turns the two-arg form into the three-arg one? Writing strcat_s
(and strcpy_s which is also used) is not hard, and I would prefer a
solution that lets me leave the original source untouched.