rkdeveloptool icon indicating copy to clipboard operation
rkdeveloptool copied to clipboard

Change sprintf to snprintf

Open quanghd96 opened this issue 2 years ago • 4 comments

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

quanghd96 avatar Nov 05 '22 07:11 quanghd96

Thanks so much - this saved me!

@rockchip-linux this fixes builds.

sammcj avatar Feb 07 '23 00:02 sammcj

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

lukas avatar Aug 24 '23 18:08 lukas

@keveryang @Caesar-github please merge this important PR

christian-tsmx avatar Nov 15 '23 10:11 christian-tsmx