opensim-org / opensim-core

SimTK OpenSim C++ libraries and command-line applications, and Java/Python wrapping.
https://opensim.stanford.edu
Apache License 2.0
783 stars 316 forks source link

Replace usages of `sprintf` with `snprintf` #3658

Closed nickbianco closed 9 months ago

nickbianco commented 9 months ago

Brief summary of changes

As the title suggests, snprintf replaces all usages of sprintf, which can be dangerous because it can potentially output more characters than can fit in the allocation size of the buffer string. The change suppresses a gcc compiler warning (which was the main motivation for the PR).

Testing I've completed

Looking for feedback on...

CHANGELOG.md (choose one)


This change is Reviewable