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

Refactor excessive logic/side effects in return statement #876

Closed
skliper opened this issue Mar 10, 2021 · 0 comments · Fixed by #900 or #917
Closed

Refactor excessive logic/side effects in return statement #876

skliper opened this issue Mar 10, 2021 · 0 comments · Fixed by #900 or #917
Assignees
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Mar 10, 2021

Is your feature request related to a problem? Please describe.
Excessive logic in OS_FileSys_FindVirtMountPoint return statement. This isn't coding standard compliant and takes a while to sort out when first observed:

return (mplen > 0 && mplen < sizeof(filesys->virtual_mountpt) &&
strncmp(target, filesys->virtual_mountpt, mplen) == 0 && (target[mplen] == '/' || target[mplen] == 0));

Describe the solution you'd like
Refactor/comment to make more clear.

Describe alternatives you've considered
None

Additional context
None

Requester Info
Jacob Hageman - NASA/GSFC, OSAL code review

@skliper skliper added this to the 6.0.0 milestone Mar 10, 2021
jphickey added a commit to jphickey/osal that referenced this issue Mar 12, 2021
The return statement from OS_FileSys_FindVirtMountPoint() was
performing several match operations and was hard to understand.

This breaks up the statement so it is easier to read and adds
some informational comments.
astrogeco added a commit that referenced this issue Mar 22, 2021
Fix #876, break up logic in return statement
jphickey pushed a commit to jphickey/osal that referenced this issue Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants