Skip to content

convert sprintf calls to snprintf #267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lunarpapillo
Copy link

Partly addresses:

mac build provokes warnings
https://github.com/ValveSoftware/Fossilize/issues/266

Many implementations have deprecated sprintf() in favor of snprintf(), including macOS with latest Xcode and Windows if _CRT_SECURE_NO_WARNINGS is set.

This change converts all uses of sprintf() to snprintf(). In most cases this is simply converting
sprintf(x, ...)
to
snprintf(x, sizeof(x), ...)

But there are a few more complicated constructions in fossilize_replay.cpp, fossilize_db.cpp, and layer/instance.cpp.

Partly addresses:

    mac build provokes warnings
    ValveSoftware#266

Many implementations have deprecated sprintf() in favor of snprintf(), including
macOS with latest Xcode and Windows if _CRT_SECURE_NO_WARNINGS is set.

This change converts all uses of sprintf() to snprintf().  In most cases this is
simply converting
    sprintf(x, ...)
to
    snprintf(x, sizeof(x), ...)

But there are a few more complicated constructions in fossilize_replay.cpp,
fossilize_db.cpp, and layer/instance.cpp.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant