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

feat: changed BoundedString::copy to copy up to length-pos characters #779

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

daantimmer
Copy link
Contributor

@daantimmer daantimmer commented Nov 27, 2024

The standard library's std::string::copy has the following behaviour:

Copies a substring [pos, pos + count) to character string pointed to by dest.
If the requested substring lasts past the end of the string, or if count == npos,
the copied substring is [pos, size()).

The current behaviour of BoundedString::copy is to error when pos+count > length which is different from the standard string copy behaviour.

This change aligns BoundedString::copy with the above behaviour.

@daantimmer daantimmer requested a review from a team as a code owner November 27, 2024 07:41
Copy link
Contributor

github-actions bot commented Nov 27, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

@daantimmer daantimmer changed the title feat: changed BoundedVector::copy to copy up to length-pos characters feat: changed BoundedString::copy to copy up to length-pos characters Nov 27, 2024
Copy link
Contributor

github-actions bot commented Nov 27, 2024

🦙 MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors Elapsed time
✅ ACTION actionlint 12 0 0.08s
✅ CPP clang-format 994 3 0 6.69s
✅ DOCKERFILE hadolint 2 0 0.15s
✅ JSON jsonlint 9 0 0.19s
✅ JSON prettier 9 0 0 0.66s
⚠️ MARKDOWN markdownlint 6 0 4 1.24s
⚠️ MARKDOWN markdown-link-check 6 1 21.56s
✅ MARKDOWN markdown-table-formatter 6 0 0 0.24s
✅ REPOSITORY checkov yes no 20.4s
✅ REPOSITORY git_diff yes no 0.05s
✅ REPOSITORY grype yes no 9.53s
✅ REPOSITORY ls-lint yes no 0.07s
✅ REPOSITORY secretlint yes no 5.85s
✅ REPOSITORY trivy yes no 5.62s
✅ REPOSITORY trivy-sbom yes no 0.08s
✅ REPOSITORY trufflehog yes no 3.31s
⚠️ SPELL lychee 140 2 3.15s
⚠️ YAML prettier 23 1 1 0.86s
✅ YAML v8r 23 0 10.3s
✅ YAML yamllint 23 0 0.45s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

Copy link

sonarcloud bot commented Nov 27, 2024

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.

3 participants