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

quote.c: 2 * possible bad tests ? #22

Closed
dcb314 opened this issue Nov 21, 2016 · 2 comments
Closed

quote.c: 2 * possible bad tests ? #22

dcb314 opened this issue Nov 21, 2016 · 2 comments

Comments

@dcb314
Copy link

dcb314 commented Nov 21, 2016

quote.c:377:14: warning: logical 'and' of mutually exclusive tests is always false [-Wlogical-op]
quote.c:379:14: warning: logical 'and' of mutually exclusive tests is always false [-Wlogical-op]

Source code is

    if (
        (ch < 'a' && ch > 'z')
        &&
        (ch < '0' && ch > '9')
        &&
        ch != '_') {

I am not sure that test is ever going to succeed. Suggest code rework.

@machack666
Copy link
Collaborator

I think you're correct; I assume the inner && should be || in this case to test what the comment is indicating it is. Will fix and test.

machack666 pushed a commit that referenced this issue Nov 21, 2016
@machack666
Copy link
Collaborator

Fixed in 5fa8b72.

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

No branches or pull requests

2 participants