mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
Minor refactor
- Simplify, no need for additional local variable - Use established nomenclature Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+3
-5
@@ -284,15 +284,13 @@ char *sig2str(int sig)
|
||||
*/
|
||||
int str2sig(char *sig)
|
||||
{
|
||||
int name_offset = 0;
|
||||
size_t i;
|
||||
|
||||
if (strncasecmp(sig, "SIG", 3) == 0) {
|
||||
name_offset = 3;
|
||||
}
|
||||
if (!strncasecmp(sig, "SIG", 3))
|
||||
sig += 3;
|
||||
|
||||
for (i = 1; i < NELEMS(signames); ++i) {
|
||||
if (strcasecmp(&sig[name_offset], signames[i]) == 0)
|
||||
if (strcasecmp(sig, signames[i]) == 0)
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user