Skip to content

Remove unnecessary check of p in phpdbg_trim #10122

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

Merged
merged 1 commit into from
Dec 18, 2022

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos commented Dec 17, 2022

The check checks whether p is non-NULL. But if it were NULL the function would crash in later code, so the check is useless. It seems like *p was intended, but that is redundant as well because isspace would return false on '\0'.

EDIT: Failing test is proc_open02.phpt which seems to be unrelated, just flaky.

The check checks whether p is non-NULL. But if it were NULL the function
would crash in later code, so the check is useless.
It seems like *p was intended, but that is redundant as well because
isspace would return false on '\0'.
Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@iluuu1994 iluuu1994 merged commit e288438 into php:master Dec 18, 2022
@nielsdos nielsdos deleted the update-phpdbg_trim branch December 18, 2022 20:41
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.

2 participants