Skip to content
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

Change sprintf to snprintf #73

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

Conversation

quanghd96
Copy link

I found sprintf is deprecated now. So i can not build on some devices. I fixed it by changing sprintf to snprintf. It work fine!

main.cpp:90:3: error: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror,-Wdeprecated-declarations]
                sprintf(szText, "Tag Bad Block total %lld, current %lld", totalValue, currentValue);

Tested on Linux and MacOS

@sammcj
Copy link

sammcj commented Feb 7, 2023

Thanks so much - this saved me!

@rockchip-linux this fixes builds.

@lukas
Copy link

lukas commented Aug 24, 2023

thank you so much - I would have been stuck without this

@christian-tsmx
Copy link

@keveryang @Caesar-github please merge this important PR

@timblechmann
Copy link

could this patch potentially be merged? it is listed in the radxa's official build instructions: https://docs.radxa.com/en/compute-module/cm5/radxa-os/low-level-dev/rkdeveloptool?host-os=debian

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.

5 participants