lib/, src/: Use streq() instead of its pattern
Except for the added (and sorted) includes, the removal of redundant parentheses, a few cases that have been refactored for readability, and a couple of non-string cases that I've left out of the change, this patch can be approximated with the following semantic patch: $ cat ~/tmp/spatch/streq.sp @@ expression s; @@ - '\0' == *s + streq(s, "") @@ expression s; @@ - '\0' == s[0] + streq(s, "") @@ expression s; @@ - *s == '\0' + streq(s, "") @@ expression s; @@ - s[0] == '\0' + streq(s, "") $ find contrib/ lib* src/ -type f \ | xargs spatch --in-place --sp-file ~/tmp/spatch/streq.sp; Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
committed by
Serge Hallyn
parent
8424d7c494
commit
7182d6402f
+2
-2
@@ -413,9 +413,9 @@ static int setup_user_limits (const char *uname)
|
||||
}
|
||||
}
|
||||
(void) fclose (fil);
|
||||
if (limits[0] == '\0') {
|
||||
if (streq(limits, "")) {
|
||||
/* no user specific limits */
|
||||
if (deflimits[0] == '\0') { /* no default limits */
|
||||
if (streq(deflimits, "")) { /* no default limits */
|
||||
return 0;
|
||||
}
|
||||
strcpy (limits, deflimits); /* use the default limits */
|
||||
|
||||
Reference in New Issue
Block a user