-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix #4569: clang warning about deprecated sprintf usage. #4570
Closed
Closed
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
7b481f0
fix #4569: clang warning about deprecated sprintf usage.
ckeshava 2bf715b
Merge branch 'develop' into sprintfFix
ckeshava d6b06bc
Merge branch 'develop' into sprintfFix
ckeshava aa5ab30
fix #4569: clang warning about deprecated sprintf usage.
ckeshava a46f1e7
Trivial: add comments for NFToken-related invariants (#4558)
scottschurr 80c608b
fix node size estimation (#4536)
dangell7 6c424ca
fix: remove redundant moves (#4565)
ckeshava 470779a
Set version to 1.11.0-rc3
intelliot eaf58f2
Set version to 1.11.0
intelliot bd85cfa
Enable the Beta RPC API (v2) for all unit tests: (#4573)
ximinez 11d2723
`fixReducedOffersV1`: prevent offers from blocking order books: (#4512)
scottschurr 5a7d35c
Add RPC/WS ports to server_info (#4427)
drlongle 238a248
ci: use Artifactory remote in nix workflow (#4556)
thejohnfreeman 8520356
refactor: remove TypedField's move constructor (#4567)
HowardHinnant 0f31c65
XLS-39 Clawback: (#4553)
shawnxie999 3a7b98e
Set version to 1.12.0-b1
intelliot 29e15f4
refactor: replace hand-rolled lexicalCast (#4473)
dangell7 67289be
Fix package definition for Conan (#4485)
thejohnfreeman 284bc4a
fix: remove deprecated fields in `ledger` method (#4244)
ckeshava 7a50fee
refactor: rename ServerHandlerImp to ServerHandler (#4516)
scottschurr 18193dc
Fix build references to deleted ServerHandlerImp: (#4592)
ximinez c9f7312
APIv2: add error messages for account_tx (#4571)
PeterChen13579 a197d5b
fix: Update Handler::Condition enum values #3417 (#4239)
ckeshava 671f5df
ci: cancel overridden workflows (#4597)
thejohnfreeman 25c03c6
fix: deb package build (#4591)
legleux be217d9
APIv2(account_info): handle invalid "signer_lists" value (#4585)
PeterChen13579 8dcbbf1
chore: update checkout action version to v3: (#4598)
ximinez 0ab8147
add clang-format pre-commit hook (#4599)
mvadari d2f1759
build: add binary hardening compile and link flags (#4603)
thejohnfreeman a6664eb
fix: add allowClawback flag for `account_info` (#4590)
shawnxie999 95d67eb
refactor: change the return type of mulDiv to std::optional (#4243)
ckeshava 340b0b5
APIv2(ledger_entry): return "invalidParams" when fields missing (#4552)
arihantkothari 3d4651d
docs(CONTRIBUTING): push beta releases to `release` (#4589)
intelliot 1f66cac
Merge branch 'sprintfFix' of https:/ckeshava/rippled into…
ckeshava File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does multiple allocations. Consider using snprintf instead. Something like:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. I tried to do this in my first commit. But @a-noni-mousse had reservations with this approach (#4570 (comment))
Should I still go ahead with the snprintf approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a performance critical function, the extra allocations aren't that big a deal. On the other hand, I don't find the
snprintf
dangerous here - it's clearly not going to overwrite the buffer and it's very easy to see that. So the issues I'd weigh are:It's your call, I'll approve this with either interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm okay, thanks for the comparison.
I feel the
snprintf
adds complexity. I don't understand why we need to allocate18 + 16 + 16 + 1
as the buffer size (I mimicked the existing code's behavior)I'm inclined the favor the
std::string
version for it's simplicity.