lib/, src/: Use strspn(3) and strcspn(3) instead of their patterns - #1369
Open
alejandro-colomar wants to merge 3 commits into
Open
lib/, src/: Use strspn(3) and strcspn(3) instead of their patterns#1369alejandro-colomar wants to merge 3 commits into
alejandro-colomar wants to merge 3 commits into
Conversation
alejandro-colomar
force-pushed
the
strspn
branch
from
October 13, 2025 14:07
2d3d44d to
4e6696d
Compare
alejandro-colomar
force-pushed
the
strspn
branch
from
October 13, 2025 19:01
4e6696d to
aa7c589
Compare
Comment on lines
371
to
373
| while (fgets (buf, 1024, fil) != NULL) { | ||
| if (strprefix(buf, "#") || strprefix(buf, "\n")) { | ||
| if (!strcspn(buf, "#\n")) | ||
| continue; |
Collaborator
Author
There was a problem hiding this comment.
This reminds me of a future patch set which will check after every call to fgets(3) that there exists a \n character, and removes it. This code is bad, in the sense that it doesn't detect files with too-long lines.
alejandro-colomar
force-pushed
the
strspn
branch
6 times, most recently
from
October 19, 2025 09:07
5ac4f04 to
0b0e6b2
Compare
alejandro-colomar
force-pushed
the
strspn
branch
3 times, most recently
from
October 27, 2025 13:51
173b93f to
0eefff6
Compare
alejandro-colomar
force-pushed
the
strspn
branch
2 times, most recently
from
November 12, 2025 15:56
ca0cc99 to
94c890b
Compare
alejandro-colomar
force-pushed
the
strspn
branch
2 times, most recently
from
November 29, 2025 23:04
401db5f to
fa9e937
Compare
alejandro-colomar
force-pushed
the
strspn
branch
2 times, most recently
from
December 7, 2025 13:13
18a800c to
3b7c6bf
Compare
alejandro-colomar
force-pushed
the
strspn
branch
3 times, most recently
from
December 29, 2025 01:46
8f73135 to
fea4c8c
Compare
Collaborator
Author
|
Cc: @kees |
alejandro-colomar
force-pushed
the
strspn
branch
from
February 23, 2026 13:24
fea4c8c to
488a3fa
Compare
alejandro-colomar
force-pushed
the
strspn
branch
3 times, most recently
from
March 4, 2026 20:10
ff67274 to
0b2e4ea
Compare
alejandro-colomar
force-pushed
the
strspn
branch
from
April 12, 2026 09:10
0b2e4ea to
fbc94cb
Compare
alejandro-colomar
force-pushed
the
strspn
branch
from
June 20, 2026 21:36
fbc94cb to
2e25711
Compare
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This removes a local variable. Signed-off-by: Alejandro Colomar <alx@kernel.org>
alejandro-colomar
force-pushed
the
strspn
branch
from
July 20, 2026 21:49
2e25711 to
3360d3a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Revisions:
v1b
v2
v3
v3b
v3c
v4
v4b
v4c
v4d
v4e
v4f
v4g
v5
v6
v6b
v7
v7b
v7c
v7d
v7e
v7f