quinnj / JSON3.jl

Other
214 stars 47 forks source link

Use `sizeof` rather than `length` for file length check #260

Closed MichaelHatherly closed 1 year ago

MichaelHatherly commented 1 year ago

This issue only seems to occur when there is a file with contents that contained just enough Unicode characters to push the sizeof value over 254 while keeping length under that limit. I'd assume that isfile really actually cares about number of bytes rather than apparent character length.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (0dd0f0f) 89.69% compared to head (f0df3c6) 89.69%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #260 +/- ## ======================================= Coverage 89.69% 89.69% ======================================= Files 10 10 Lines 1775 1775 ======================================= Hits 1592 1592 Misses 183 183 ``` | [Impacted Files](https://app.codecov.io/gh/quinnj/JSON3.jl/pull/260?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jacob+Quinn) | Coverage Δ | | |---|---|---| | [src/utils.jl](https://app.codecov.io/gh/quinnj/JSON3.jl/pull/260?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jacob+Quinn#diff-c3JjL3V0aWxzLmps) | `89.47% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.