These are the only remaining uses of snprintf in our project, and they can cause unexpected issues -- for example, see #27014. Change them to use our ToString (which uses a locale-independent version of std::to_string) to convert an int to std::string. Also remove resulting unused parts of StringContentsSerializer.
test: Remove last uses of snprintf and simplify #27036
pull john-moffett wants to merge 1 commits into bitcoin:master from john-moffett:2023_02_FixDBWrapperTest changing 2 files +14 −30-
john-moffett commented at 4:48 PM on February 3, 2023: contributor
-
DrahtBot commented at 4:48 PM on February 3, 2023: contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
- DrahtBot added the label Tests on Feb 3, 2023
-
b8032293e6
Remove use of snprintf and simplify
One test case uses snprintf to convert an int to a string. Change it to use ToString (which uses a locale-independent version of std::to_string). Also remove unnecessary parts of StringContentsSerializer.
- john-moffett force-pushed on Feb 3, 2023
-
jonatack commented at 6:04 PM on February 3, 2023: contributor
Concept ACK. Maybe verify if the linter files need updating (test/lint/lint-locale-dependence.py?)
-
john-moffett commented at 6:07 PM on February 3, 2023: contributor
Maybe verify if the linter files need updating (test/lint/lint-locale-dependence.py?)
Thanks! Pushed that change about a half hour ago. You were too quick 😄
-
brunoerg commented at 8:38 PM on February 3, 2023: contributor
Concept ACK
- maflcko merged this on Feb 6, 2023
- maflcko closed this on Feb 6, 2023
- sidhujag referenced this in commit 5dc32bdc36 on Feb 6, 2023
- fanquake referenced this in commit bc35c4f58c on Feb 17, 2023
- sidhujag referenced this in commit ef111be3dd on Feb 17, 2023
- bitcoin locked this on Feb 6, 2024