Skip to content

fix the assertion in readLinesFromFile#3084

Merged
embg merged 2 commits intofacebook:devfrom
xry111:fix-garbage-filelist-assertion
Mar 4, 2022
Merged

fix the assertion in readLinesFromFile#3084
embg merged 2 commits intofacebook:devfrom
xry111:fix-garbage-filelist-assertion

Conversation

@xry111
Copy link
Contributor

@xry111 xry111 commented Mar 3, 2022

When the file is not terminated by endline, readLineFromFile will append
a '\0' for the last line. In this case pos + lineLength == dstCapacity.

@facebook-github-bot
Copy link

Hi @xry111!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@embg
Copy link
Contributor

embg commented Mar 3, 2022

The CI failures are probably unrelated, and #3082 should fix them. If you re-run checks on this PR those jobs shouldn't fail again.

xry111 added 2 commits March 4, 2022 14:17
When the file is not terminated by endline, readLineFromFile will append
a '\0' for the last line.  In this case pos + lineLength == dstCapacity.
@xry111 xry111 force-pushed the fix-garbage-filelist-assertion branch from 2f71be6 to 70f4f76 Compare March 4, 2022 06:17
@xry111
Copy link
Contributor Author

xry111 commented Mar 4, 2022

The CI failures are probably unrelated, and #3082 should fix them. If you re-run checks on this PR those jobs shouldn't fail again.

So rebased and force-pushed, waiting for the result...

@xry111 xry111 requested a review from Cyan4973 March 4, 2022 18:55
@embg embg merged commit d109cef into facebook:dev Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants