sprintf to snprintf conversion

Rob McDonald <[email protected]> Sun, 19 Feb 2023 15:37:10 -0800
Newsgroups gmane.comp.programming.swig
Message-ID <CAEppYpE3U-GhSUK6fiZ+rrHPkc0TWR6DgQvnf_6e_Uvt8J7-+Q@mail.gmail.com>
Recent versions of clang / xcode have deprecated sprintf to the point where
the warning messages are getting overwhelming (nine long lines of output
for each occurrence).

Some of these appear in SWIG generated code (Python wrapping) in my
project.  It would be great if SWIG could change calls from
sprintf(str,….); to snprintf(str,sizeof(str),…);

It would also be great if you received the return code and handled errors,
but even without that, the code should be safer than it is now – and the
warnings will go away.

I see calls to sprintf in 'setslice' and 'SwigPySequence_Ref'


Thanks.

Rob

_______________________________________________
Swig-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/swig-user