Line | Source | Count |
1 | | - |
2 | | - |
3 | extern int | - |
4 | operand2sig (char const *operand, char *signame) | - |
5 | { | - |
6 | int signum; | - |
7 | | - |
8 | if (((TRUE | evaluated 11 times by 1 test | FALSE | evaluated 16 times by 2 tests |
unsigned int) (*operand) - '0' <= 9)TRUE | evaluated 11 times by 1 test | FALSE | evaluated 16 times by 2 tests |
) | 11-16 |
9 | { | - |
10 | char *endp; | - |
11 | long int l = ( | - |
12 | (*__errno_location ()) | - |
13 | = 0, strtol (operand, &endp, 10)); | - |
14 | int i = l; | - |
15 | signum = (operand == endpTRUE | never evaluated | FALSE | evaluated 11 times by 1 test |
|| *TRUE | never evaluated | FALSE | evaluated 11 times by 1 test |
endpTRUE | never evaluated | FALSE | evaluated 11 times by 1 test |
|| | 0-11 |
16 | (*TRUE | never evaluated | FALSE | evaluated 11 times by 1 test |
__errno_location ())TRUE | never evaluated | FALSE | evaluated 11 times by 1 test |
| 0-11 |
17 | || i != lTRUE | never evaluated | FALSE | evaluated 11 times by 1 test |
? -1 : i); | 0-11 |
18 | | - |
19 | if (signum != -1TRUE | evaluated 11 times by 1 test | FALSE | never evaluated |
) | 0-11 |
20 | { | - |
21 | | - |
22 | | - |
23 | | - |
24 | signum &= signum >= 0xFFTRUE | evaluated 1 time by 1 test | FALSE | evaluated 10 times by 1 test |
? 0xFF : 0x7F; | 1-10 |
25 | }executed 11 times by 1 test: end of block | 11 |
26 | }executed 11 times by 1 test: end of block | 11 |
27 | else | - |
28 | { | - |
29 | | - |
30 | | - |
31 | char *upcased = xstrdup (operand); | - |
32 | char *p; | - |
33 | for (p = upcased; *TRUE | evaluated 67 times by 2 tests | FALSE | evaluated 16 times by 2 tests |
pTRUE | evaluated 67 times by 2 tests | FALSE | evaluated 16 times by 2 tests |
; p++) | 16-67 |
34 | if ( | - |
35 | (TRUE | evaluated 18 times by 2 tests | FALSE | evaluated 49 times by 2 tests |
__extension__ (__builtin_constant_p (TRUE | never evaluated | FALSE | evaluated 67 times by 2 tests |
TRUE | evaluated 18 times by 2 tests | FALSE | evaluated 49 times by 2 tests |
| 0-67 |
36 | *pTRUE | never evaluated | FALSE | evaluated 67 times by 2 tests |
TRUE | evaluated 18 times by 2 tests | FALSE | evaluated 49 times by 2 tests |
| 0-67 |
37 | )TRUE | never evaluated | FALSE | evaluated 67 times by 2 tests |
&& !__builtin_constant_p (TRUE | never evaluated | FALSE | never evaluated |
TRUE | evaluated 18 times by 2 tests | FALSE | evaluated 49 times by 2 tests |
| 0-67 |
38 | "abcdefghijklmnopqrstuvwxyz"TRUE | never evaluated | FALSE | never evaluated |
TRUE | evaluated 18 times by 2 tests | FALSE | evaluated 49 times by 2 tests |
| 0-49 |
39 | )TRUE | never evaluated | FALSE | never evaluated |
&& (TRUE | never evaluated | FALSE | never evaluated |
TRUE | evaluated 18 times by 2 tests | FALSE | evaluated 49 times by 2 tests |
| 0-49 |
40 | *pTRUE | never evaluated | FALSE | never evaluated |
TRUE | evaluated 18 times by 2 tests | FALSE | evaluated 49 times by 2 tests |
| 0-49 |
41 | ) == '\0'TRUE | never evaluated | FALSE | never evaluated |
? (char *) __rawmemchr (TRUE | evaluated 18 times by 2 tests | FALSE | evaluated 49 times by 2 tests |
| 0-49 |
42 | "abcdefghijklmnopqrstuvwxyz"TRUE | evaluated 18 times by 2 tests | FALSE | evaluated 49 times by 2 tests |
| 18-49 |
43 | , TRUE | evaluated 18 times by 2 tests | FALSE | evaluated 49 times by 2 tests |
| 18-49 |
44 | *pTRUE | evaluated 18 times by 2 tests | FALSE | evaluated 49 times by 2 tests |
| 18-49 |
45 | ) : __builtin_strchr (TRUE | evaluated 18 times by 2 tests | FALSE | evaluated 49 times by 2 tests |
| 18-49 |
46 | "abcdefghijklmnopqrstuvwxyz"TRUE | evaluated 18 times by 2 tests | FALSE | evaluated 49 times by 2 tests |
| 18-49 |
47 | , TRUE | evaluated 18 times by 2 tests | FALSE | evaluated 49 times by 2 tests |
| 18-49 |
48 | *pTRUE | evaluated 18 times by 2 tests | FALSE | evaluated 49 times by 2 tests |
| 18-49 |
49 | )))TRUE | evaluated 18 times by 2 tests | FALSE | evaluated 49 times by 2 tests |
| 18-49 |
50 | ) | - |
51 | *executed 18 times by 2 tests: *p += 'A' - 'a'; p += 'A' - 'a';executed 18 times by 2 tests: *p += 'A' - 'a'; | 18 |
52 | | - |
53 | | - |
54 | | - |
55 | if (!(str2sig (upcased, &signum) == 0TRUE | evaluated 10 times by 2 tests | FALSE | evaluated 6 times by 2 tests |
| 6-10 |
56 | || (upcased[0] == 'S'TRUE | never evaluated | FALSE | evaluated 6 times by 2 tests |
&& upcased[1] == 'I'TRUE | never evaluated | FALSE | never evaluated |
&& upcased[2] == 'G'TRUE | never evaluated | FALSE | never evaluated |
| 0-6 |
57 | && str2sig (upcased + 3, &signum) == 0TRUE | never evaluated | FALSE | never evaluated |
))) | 0 |
58 | signum = -1;executed 6 times by 2 tests: signum = -1; | 6 |
59 | | - |
60 | free (upcased); | - |
61 | }executed 16 times by 2 tests: end of block | 16 |
62 | | - |
63 | if (signum < 0TRUE | evaluated 6 times by 2 tests | FALSE | evaluated 21 times by 2 tests |
|| sig2str (signum, signame) != 0TRUE | never evaluated | FALSE | evaluated 21 times by 2 tests |
) | 0-21 |
64 | { | - |
65 | error (0, 0, | - |
66 | dcgettext (((void *)0), | - |
67 | "%s: invalid signal" | - |
68 | , 5) | - |
69 | , quote (operand)); | - |
70 | returnexecuted 6 times by 2 tests: return -1; -1;executed 6 times by 2 tests: return -1; | 6 |
71 | } | - |
72 | | - |
73 | returnexecuted 21 times by 2 tests: return signum; signum;executed 21 times by 2 tests: return signum; | 21 |
74 | } | - |
| | |