OpenCoverage

nstrftime.c #2

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/lib/nstrftime.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8static void-
9fwrite_lowcase (FILE *fp, const char *src, size_t len)-
10{-
11 while (len-- > 0
len-- > 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
12 {-
13 fputc (-
14 (__extension__ ({ int __res; if (sizeof (
sizeof ( (unsi...ar) *src ) > 1Description
TRUEnever evaluated
FALSEnever evaluated
0
15 (unsigned char) *src
sizeof ( (unsi...ar) *src ) > 1Description
TRUEnever evaluated
FALSEnever evaluated
0
16 ) > 1
sizeof ( (unsi...ar) *src ) > 1Description
TRUEnever evaluated
FALSEnever evaluated
) { if (__builtin_constant_p (
__builtin_cons...d char) *src )Description
TRUEnever evaluated
FALSEnever evaluated
0
17 (unsigned char) *src
__builtin_cons...d char) *src )Description
TRUEnever evaluated
FALSEnever evaluated
0
18 )
__builtin_cons...d char) *src )Description
TRUEnever evaluated
FALSEnever evaluated
) { int __c = (
0
19 (unsigned char) *src-
20 ); __res = __c < -128
__c < -128Description
TRUEnever evaluated
FALSEnever evaluated
|| __c > 255
__c > 255Description
TRUEnever evaluated
FALSEnever evaluated
? __c : (*__ctype_tolower_loc ())[__c]; }
never executed: end of block
else __res = tolower (
never executed: __res = tolower ( (unsigned char) *src );
0
21 (unsigned char) *src
never executed: __res = tolower ( (unsigned char) *src );
0
22 );
never executed: __res = tolower ( (unsigned char) *src );
} else __res = (*__ctype_tolower_loc ())[(int) (
never executed: __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char) *src )];
0
23 (unsigned char) *src
never executed: __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char) *src )];
0
24 )];
never executed: __res = (*__ctype_tolower_loc ())[(int) ( (unsigned char) *src )];
__res; }))
0
25 , fp);-
26 ++src;-
27 }
never executed: end of block
0
28}
never executed: end of block
0
29-
30static void-
31fwrite_uppcase (FILE *fp, const char *src, size_t len)-
32{-
33 while (len-- > 0
len-- > 0Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • date
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
)
2-48
34 {-
35 fputc (-
36 (__extension__ ({ int __res; if (sizeof (
sizeof ( (unsi...ar) *src ) > 1Description
TRUEnever evaluated
FALSEevaluated 48 times by 1 test
Evaluated by:
  • date
0-48
37 (unsigned char) *src
sizeof ( (unsi...ar) *src ) > 1Description
TRUEnever evaluated
FALSEevaluated 48 times by 1 test
Evaluated by:
  • date
0-48
38 ) > 1
sizeof ( (unsi...ar) *src ) > 1Description
TRUEnever evaluated
FALSEevaluated 48 times by 1 test
Evaluated by:
  • date
) { if (__builtin_constant_p (
__builtin_cons...d char) *src )Description
TRUEnever evaluated
FALSEnever evaluated
0-48
39 (unsigned char) *src
__builtin_cons...d char) *src )Description
TRUEnever evaluated
FALSEnever evaluated
0
40 )
__builtin_cons...d char) *src )Description
TRUEnever evaluated
FALSEnever evaluated
) { int __c = (
0
41 (unsigned char) *src-
42 ); __res = __c < -128
__c < -128Description
TRUEnever evaluated
FALSEnever evaluated
|| __c > 255
__c > 255Description
TRUEnever evaluated
FALSEnever evaluated
? __c : (*__ctype_toupper_loc ())[__c]; }
never executed: end of block
else __res = toupper (
never executed: __res = toupper ( (unsigned char) *src );
0
43 (unsigned char) *src
never executed: __res = toupper ( (unsigned char) *src );
0
44 );
never executed: __res = toupper ( (unsigned char) *src );
} else __res = (*__ctype_toupper_loc ())[(int) (
executed 48 times by 1 test: __res = (*__ctype_toupper_loc ())[(int) ( (unsigned char) *src )];
Executed by:
  • date
0-48
45 (unsigned char) *src
executed 48 times by 1 test: __res = (*__ctype_toupper_loc ())[(int) ( (unsigned char) *src )];
Executed by:
  • date
48
46 )];
executed 48 times by 1 test: __res = (*__ctype_toupper_loc ())[(int) ( (unsigned char) *src )];
Executed by:
  • date
__res; }))
48
47 , fp);-
48 ++src;-
49 }
executed 48 times by 1 test: end of block
Executed by:
  • date
48
50}
executed 2 times by 1 test: end of block
Executed by:
  • date
2
51static int iso_week_days (int, int);-
52-
53__inline__-
54-
55static int-
56iso_week_days (int yday, int wday)-
57{-
58-
59 int big_enough_multiple_of_7 = (-(-366) / 7 + 2) * 7;-
60 return
executed 16 times by 1 test: return (yday - (yday - wday + 4 + big_enough_multiple_of_7) % 7 + 4 - 1);
Executed by:
  • date
(yday
executed 16 times by 1 test: return (yday - (yday - wday + 4 + big_enough_multiple_of_7) % 7 + 4 - 1);
Executed by:
  • date
16
61 - (yday - wday + 4 + big_enough_multiple_of_7) % 7
executed 16 times by 1 test: return (yday - (yday - wday + 4 + big_enough_multiple_of_7) % 7 + 4 - 1);
Executed by:
  • date
16
62 + 4 - 1);
executed 16 times by 1 test: return (yday - (yday - wday + 4 + big_enough_multiple_of_7) % 7 + 4 - 1);
Executed by:
  • date
16
63}-
64static size_t __strftime_internal (FILE *,-
65 const char *, const struct tm *,-
66 -
67 _Bool-
68 , -
69 _Bool -
70 *-
71 , timezone_t tz, int ns );-
72-
73-
74-
75-
76-
77-
78-
79size_t-
80fprintftime (FILE *s,-
81 const char *format,-
82 const struct tm *tp , timezone_t tz, int ns )-
83{-
84 -
85 _Bool -
86 tzset_called = -
87 0-
88 ;-
89 return
executed 4796 times by 6 tests: return __strftime_internal (s, format, tp, 0 , &tzset_called , tz, ns );
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
__strftime_internal (s, format, tp,
executed 4796 times by 6 tests: return __strftime_internal (s, format, tp, 0 , &tzset_called , tz, ns );
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
4796
90
executed 4796 times by 6 tests: return __strftime_internal (s, format, tp, 0 , &tzset_called , tz, ns );
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
4796
91 0
executed 4796 times by 6 tests: return __strftime_internal (s, format, tp, 0 , &tzset_called , tz, ns );
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
4796
92 , &tzset_called , tz, ns );
executed 4796 times by 6 tests: return __strftime_internal (s, format, tp, 0 , &tzset_called , tz, ns );
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
4796
93}-
94-
95-
96-
97-
98-
99-
100-
101static size_t-
102__strftime_internal (FILE *s,-
103 const char *format,-
104 const struct tm *tp, -
105 _Bool -
106 upcase, -
107 _Bool -
108 *tzset_called-
109 , timezone_t tz, int ns )-
110{-
111-
112-
113-
114-
115 size_t maxsize = (size_t) -1;-
116-
117-
118 int hour12 = tp->tm_hour;-
119 const char *zone;-
120 size_t i = 0;-
121 FILE *p = s;-
122 const char *f;-
123 zone = -
124 ((void *)0)-
125 ;-
126-
127-
128-
129-
130-
131-
132-
133 zone = (const char *) tp->tm_zone;-
134 if (! zone
! zoneDescription
TRUEnever evaluated
FALSEevaluated 4964 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
)
0-4964
135 zone = "";
never executed: zone = "";
0
136-
137 if (hour12 > 12
hour12 > 12Description
TRUEevaluated 2029 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
FALSEevaluated 2935 times by 5 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
)
2029-2935
138 hour12 -= 12;
executed 2029 times by 6 tests: hour12 -= 12;
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
2029
139 else-
140 if (hour12 == 0
hour12 == 0Description
TRUEevaluated 2480 times by 2 tests
Evaluated by:
  • date
  • stat
FALSEevaluated 455 times by 4 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
)
455-2480
141 hour12 = 12;
executed 2480 times by 2 tests: hour12 = 12;
Executed by:
  • date
  • stat
2480
142-
143 for (f = format; *
*f != '\0'Description
TRUEevaluated 68232 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
FALSEevaluated 4964 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
f != '\0'
*f != '\0'Description
TRUEevaluated 68232 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
FALSEevaluated 4964 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
; ++f)
4964-68232
144 {-
145 int pad = 0;-
146 int modifier;-
147 int digits = 0;-
148 int number_value;-
149 unsigned int u_number_value;-
150 -
151 _Bool -
152 negative_number;-
153 -
154 _Bool -
155 always_output_a_sign;-
156 int tz_colon_mask;-
157 const char *subfmt;-
158 char sign_char;-
159 char *bufp;-
160 char buf[1-
161 + 2-
162 + (sizeof (int) < sizeof (time_t)-
163 ? ((sizeof (time_t) * 8 - 1) * 146 / 485 + 2)-
164 : ((sizeof (int) * 8 - 1) * 146 / 485 + 2))];-
165 int width = -1;-
166 -
167 _Bool -
168 to_lowcase = -
169 0-
170 ;-
171 -
172 _Bool -
173 to_uppcase = upcase;-
174 size_t colons;-
175 -
176 _Bool -
177 change_case = -
178 0-
179 ;-
180 int format_char;-
181 if (*
*f != '%'Description
TRUEevaluated 52226 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
FALSEevaluated 16006 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
f != '%'
*f != '%'Description
TRUEevaluated 52226 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
FALSEevaluated 16006 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
)
16006-52226
182 {-
183 do { size_t _n = (1); size_t _w = (width < 0
width < 0Description
TRUEevaluated 893 times by 2 tests
Evaluated by:
  • date
  • du
FALSEnever evaluated
? 0 : width); size_t _incr = _n < _w
_n < _wDescription
TRUEnever evaluated
FALSEevaluated 893 times by 2 tests
Evaluated by:
  • date
  • du
? _w : _n; if (_incr >= maxsize - i
_incr >= maxsize - iDescription
TRUEnever evaluated
FALSEevaluated 52226 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
) return
never executed: return 0;
0;
never executed: return 0;
if (p
pDescription
TRUEevaluated 41295 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
FALSEevaluated 10931 times by 2 tests
Evaluated by:
  • date
  • pr
) { if (digits == 0
digits == 0Description
TRUEevaluated 41295 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
FALSEnever evaluated
&& _n < _w
_n < _wDescription
TRUEnever evaluated
FALSEevaluated 41295 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
) { size_t _delta = width - _n; if (pad == '0'
pad == '0'Description
TRUEnever evaluated
FALSEnever evaluated
) do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEevaluated 51333 times by 5 tests
Evaluated by:
  • date
  • ls
  • pr
  • stat
  • vdir
FALSEnever evaluated
; _i++) fputc ('0', p);
never executed: fputc ('0', p);
}
never executed: end of block
while (0); else do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEnever evaluated
FALSEevaluated 51333 times by 5 tests
Evaluated by:
  • date
  • ls
  • pr
  • stat
  • vdir
; _i++) fputc (' ', p);
executed 40570 times by 5 tests: fputc (' ', p);
Executed by:
  • date
  • ls
  • pr
  • stat
  • vdir
}
never executed: end of block
while (0); } fputc (*f, p); ; }
executed 725 times by 2 tests: end of block
Executed by:
  • date
  • du
i += _incr; } while (0);
0-52226
184 continue;
executed 52226 times by 6 tests: continue;
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
52226
185 }-
186-
187-
188-
189-
190 while (1)-
191 {-
192 switch (*++f)-
193 {-
194-
195 case
executed 4 times by 1 test: case '_':
Executed by:
  • date
'_':
executed 4 times by 1 test: case '_':
Executed by:
  • date
4
196 case
never executed: case '-':
'-':
never executed: case '-':
0
197 case
executed 4 times by 1 test: case '0':
Executed by:
  • date
'0':
executed 4 times by 1 test: case '0':
Executed by:
  • date
4
198 pad = *f;-
199 continue;
executed 8 times by 1 test: continue;
Executed by:
  • date
8
200-
201-
202 case
executed 2 times by 1 test: case '^':
Executed by:
  • date
'^':
executed 2 times by 1 test: case '^':
Executed by:
  • date
2
203 to_uppcase = -
204 1-
205 ;-
206 continue;
executed 2 times by 1 test: continue;
Executed by:
  • date
2
207 case
never executed: case '#':
'#':
never executed: case '#':
0
208 change_case = -
209 1-
210 ;-
211 continue;
never executed: continue;
0
212-
213 default
executed 16006 times by 6 tests: default:
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
:
executed 16006 times by 6 tests: default:
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
16006
214 break;
executed 16006 times by 6 tests: break;
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
16006
215 }-
216 break;
executed 16006 times by 6 tests: break;
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
16006
217 }-
218-
219-
220 if (((
((unsigned int...f) - '0' <= 9)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • date
FALSEevaluated 15994 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
unsigned int) (*f) - '0' <= 9)
((unsigned int...f) - '0' <= 9)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • date
FALSEevaluated 15994 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
)
12-15994
221 {-
222 width = 0;-
223 do-
224 {-
225 if (width > 0x7fffffff / 10
width > 0x7fffffff / 10Description
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • date
0-18
226 || (width == 0x7fffffff / 10
width == 0x7fffffff / 10Description
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • date
&& *
*f - '0' > 0x7fffffff % 10Description
TRUEnever evaluated
FALSEnever evaluated
f - '0' > 0x7fffffff % 10
*f - '0' > 0x7fffffff % 10Description
TRUEnever evaluated
FALSEnever evaluated
))
0-18
227-
228 width = 0x7fffffff;
never executed: width = 0x7fffffff;
0
229 else-
230 {-
231 width *= 10;-
232 width += *f - '0';-
233 }
executed 18 times by 1 test: end of block
Executed by:
  • date
18
234 ++f;-
235 }
executed 18 times by 1 test: end of block
Executed by:
  • date
18
236 while (((
((unsigned int...f) - '0' <= 9)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • date
FALSEevaluated 12 times by 1 test
Evaluated by:
  • date
unsigned int) (*f) - '0' <= 9)
((unsigned int...f) - '0' <= 9)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • date
FALSEevaluated 12 times by 1 test
Evaluated by:
  • date
);
6-12
237 }
executed 12 times by 1 test: end of block
Executed by:
  • date
12
238-
239-
240 switch (*f)-
241 {-
242 case
never executed: case 'E':
'E':
never executed: case 'E':
0
243 case
never executed: case 'O':
'O':
never executed: case 'O':
0
244 modifier = *f++;-
245 break;
never executed: break;
0
246-
247 default
executed 16006 times by 6 tests: default:
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
:
executed 16006 times by 6 tests: default:
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
16006
248 modifier = 0;-
249 break;
executed 16006 times by 6 tests: break;
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
16006
250 }-
251-
252-
253 format_char = *f;-
254 switch (format_char)-
255 {-
256 case
executed 26 times by 3 tests: case '%':
Executed by:
  • date
  • du
  • pr
'%':
executed 26 times by 3 tests: case '%':
Executed by:
  • date
  • du
  • pr
26
257 if (modifier != 0
modifier != 0Description
TRUEnever evaluated
FALSEevaluated 26 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
)
0-26
258 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
259 do { size_t _n = (1); size_t _w = (width < 0
width < 0Description
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • date
  • du
FALSEnever evaluated
? 0 : width); size_t _incr = _n < _w
_n < _wDescription
TRUEnever evaluated
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • date
  • du
? _w : _n; if (_incr >= maxsize - i
_incr >= maxsize - iDescription
TRUEnever evaluated
FALSEevaluated 26 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
) return
never executed: return 0;
0;
never executed: return 0;
if (p
pDescription
TRUEevaluated 18 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
FALSEevaluated 8 times by 1 test
Evaluated by:
  • pr
) { if (digits == 0
digits == 0Description
TRUEevaluated 18 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
FALSEnever evaluated
&& _n < _w
_n < _wDescription
TRUEnever evaluated
FALSEevaluated 18 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
) { size_t _delta = width - _n; if (pad == '0'
pad == '0'Description
TRUEnever evaluated
FALSEnever evaluated
) do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • pr
FALSEnever evaluated
; _i++) fputc ('0', p);
never executed: fputc ('0', p);
}
never executed: end of block
while (0); else do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • pr
; _i++) fputc (' ', p);
executed 8 times by 1 test: fputc (' ', p);
Executed by:
  • pr
}
never executed: end of block
while (0); } fputc (*f, p); ; }
executed 10 times by 2 tests: end of block
Executed by:
  • date
  • du
i += _incr; } while (0);
0-26
260 break;
executed 26 times by 3 tests: break;
Executed by:
  • date
  • du
  • pr
26
261-
262 case
executed 15 times by 1 test: case 'a':
Executed by:
  • date
'a':
executed 15 times by 1 test: case 'a':
Executed by:
  • date
15
263 if (modifier != 0
modifier != 0Description
TRUEnever evaluated
FALSEevaluated 15 times by 1 test
Evaluated by:
  • date
)
0-15
264 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
265 if (change_case
change_caseDescription
TRUEnever evaluated
FALSEevaluated 15 times by 1 test
Evaluated by:
  • date
)
0-15
266 {-
267 to_uppcase = -
268 1-
269 ;-
270 to_lowcase = -
271 0-
272 ;-
273 }
never executed: end of block
0
274-
275-
276-
277-
278 goto
executed 15 times by 1 test: goto underlying_strftime;
Executed by:
  • date
underlying_strftime;
executed 15 times by 1 test: goto underlying_strftime;
Executed by:
  • date
15
279-
280-
281 case
executed 2 times by 1 test: case 'A':
Executed by:
  • date
'A':
executed 2 times by 1 test: case 'A':
Executed by:
  • date
2
282 if (modifier != 0
modifier != 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
)
0-2
283 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
284 if (change_case
change_caseDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
)
0-2
285 {-
286 to_uppcase = -
287 1-
288 ;-
289 to_lowcase = -
290 0-
291 ;-
292 }
never executed: end of block
0
293-
294-
295-
296-
297 goto
executed 2 times by 1 test: goto underlying_strftime;
Executed by:
  • date
underlying_strftime;
executed 2 times by 1 test: goto underlying_strftime;
Executed by:
  • date
2
298-
299-
300 case
executed 38 times by 3 tests: case 'b':
Executed by:
  • date
  • du
  • pr
'b':
executed 38 times by 3 tests: case 'b':
Executed by:
  • date
  • du
  • pr
38
301 case
executed 4 times by 1 test: case 'h':
Executed by:
  • date
'h':
executed 4 times by 1 test: case 'h':
Executed by:
  • date
4
302 if (change_case
change_caseDescription
TRUEnever evaluated
FALSEevaluated 42 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
)
0-42
303 {-
304 to_uppcase = -
305 1-
306 ;-
307 to_lowcase = -
308 0-
309 ;-
310 }
never executed: end of block
0
311 if (modifier == 'E'
modifier == 'E'Description
TRUEnever evaluated
FALSEevaluated 42 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
)
0-42
312 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
313-
314-
315-
316-
317-
318-
319-
320 goto
executed 42 times by 3 tests: goto underlying_strftime;
Executed by:
  • date
  • du
  • pr
underlying_strftime;
executed 42 times by 3 tests: goto underlying_strftime;
Executed by:
  • date
  • du
  • pr
42
321-
322-
323 case
executed 2 times by 1 test: case 'B':
Executed by:
  • date
'B':
executed 2 times by 1 test: case 'B':
Executed by:
  • date
2
324 if (modifier == 'E'
modifier == 'E'Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
)
0-2
325 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
326 if (change_case
change_caseDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
)
0-2
327 {-
328 to_uppcase = -
329 1-
330 ;-
331 to_lowcase = -
332 0-
333 ;-
334 }
never executed: end of block
0
335-
336-
337-
338-
339-
340-
341-
342 goto
executed 2 times by 1 test: goto underlying_strftime;
Executed by:
  • date
underlying_strftime;
executed 2 times by 1 test: goto underlying_strftime;
Executed by:
  • date
2
343-
344-
345 case
executed 2 times by 1 test: case 'c':
Executed by:
  • date
'c':
executed 2 times by 1 test: case 'c':
Executed by:
  • date
2
346 if (modifier == 'O'
modifier == 'O'Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
)
0-2
347 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
348 goto
executed 2 times by 1 test: goto underlying_strftime;
Executed by:
  • date
underlying_strftime;
executed 2 times by 1 test: goto underlying_strftime;
Executed by:
  • date
2
349-
350-
351 subformat:-
352 {-
353 size_t len = __strftime_internal (-
354 ((void *)0)-
355 ,-
356 subfmt,-
357 tp, to_uppcase, tzset_called-
358 , tz, ns );-
359 do { size_t _n = (len); size_t _w = (width < 0
width < 0Description
TRUEevaluated 84 times by 1 test
Evaluated by:
  • date
FALSEnever evaluated
? 0 : width); size_t _incr = _n < _w
_n < _wDescription
TRUEnever evaluated
FALSEevaluated 84 times by 1 test
Evaluated by:
  • date
? _w : _n; if (_incr >= maxsize - i
_incr >= maxsize - iDescription
TRUEnever evaluated
FALSEevaluated 84 times by 1 test
Evaluated by:
  • date
) return
never executed: return 0;
0;
never executed: return 0;
if (p
pDescription
TRUEevaluated 84 times by 1 test
Evaluated by:
  • date
FALSEnever evaluated
) { if (digits == 0
digits == 0Description
TRUEevaluated 84 times by 1 test
Evaluated by:
  • date
FALSEnever evaluated
&& _n < _w
_n < _wDescription
TRUEnever evaluated
FALSEevaluated 84 times by 1 test
Evaluated by:
  • date
) { size_t _delta = width - _n; if (pad == '0'
pad == '0'Description
TRUEnever evaluated
FALSEnever evaluated
) do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEnever evaluated
FALSEnever evaluated
; _i++) fputc ('0', p);
never executed: fputc ('0', p);
}
never executed: end of block
while (0); else do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEnever evaluated
FALSEnever evaluated
; _i++) fputc (' ', p);
never executed: fputc (' ', p);
}
never executed: end of block
while (0); } __strftime_internal (p, subfmt, tp, to_uppcase, tzset_called , tz, ns ); ; }
executed 84 times by 1 test: end of block
Executed by:
  • date
i += _incr; } while (0)
0-84
360-
361-
362-
363 ;-
364 }-
365 break;
executed 84 times by 1 test: break;
Executed by:
  • date
84
366-
367-
368 underlying_strftime:-
369 {-
370-
371-
372 char ufmt[5];-
373 char *u = ufmt;-
374 char ubuf[1024];-
375 size_t len;-
376 *u++ = ' ';-
377 *u++ = '%';-
378 if (modifier != 0
modifier != 0Description
TRUEnever evaluated
FALSEevaluated 71 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
)
0-71
379 *
never executed: *u++ = modifier;
u++ = modifier;
never executed: *u++ = modifier;
0
380 *u++ = format_char;-
381 *u = '\0';-
382 len = strftime (ubuf, sizeof ubuf, ufmt, tp);-
383 if (len != 0
len != 0Description
TRUEevaluated 71 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
FALSEnever evaluated
)
0-71
384 do { size_t _n = ((len - 1)); size_t _w = (width < 0
width < 0Description
TRUEevaluated 55 times by 2 tests
Evaluated by:
  • date
  • du
FALSEnever evaluated
? 0 : width); size_t _incr = _n < _w
_n < _wDescription
TRUEnever evaluated
FALSEevaluated 55 times by 2 tests
Evaluated by:
  • date
  • du
? _w : _n; if (_incr >= maxsize - i
_incr >= maxsize - iDescription
TRUEnever evaluated
FALSEevaluated 71 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
) return
never executed: return 0;
0;
never executed: return 0;
if (p
pDescription
TRUEevaluated 63 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
FALSEevaluated 8 times by 1 test
Evaluated by:
  • pr
) { if (digits == 0
digits == 0Description
TRUEevaluated 63 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
FALSEnever evaluated
&& _n < _w
_n < _wDescription
TRUEnever evaluated
FALSEevaluated 63 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
) { size_t _delta = width - _n; if (pad == '0'
pad == '0'Description
TRUEnever evaluated
FALSEnever evaluated
) do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • pr
FALSEnever evaluated
; _i++) fputc ('0', p);
never executed: fputc ('0', p);
}
never executed: end of block
while (0); else do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEnever evaluated
FALSEevaluated 16 times by 1 test
Evaluated by:
  • pr
; _i++) fputc (' ', p);
never executed: fputc (' ', p);
}
never executed: end of block
while (0); } do { if (to_lowcase
to_lowcaseDescription
TRUEnever evaluated
FALSEevaluated 63 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
) fwrite_lowcase (p, (ubuf + 1), _n);
executed 8 times by 1 test: fwrite_lowcase (p, (ubuf + 1), _n);
Executed by:
  • pr
else if (to_uppcase
to_uppcaseDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • date
FALSEevaluated 61 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
) fwrite_uppcase (p, (ubuf + 1), _n);
executed 10 times by 2 tests: fwrite_uppcase (p, (ubuf + 1), _n);
Executed by:
  • date
  • pr
else { fwrite (ubuf + 1, _n, 1, p); }
executed 69 times by 3 tests: end of block
Executed by:
  • date
  • du
  • pr
} while (0); ; }
executed 55 times by 2 tests: end of block
Executed by:
  • date
  • du
i += _incr; }
executed 55 times by 2 tests: end of block
Executed by:
  • date
  • du
while (0);
0-71
385 }-
386 break;
executed 71 times by 3 tests: break;
Executed by:
  • date
  • du
  • pr
71
387-
388-
389 case
never executed: case 'C':
'C':
never executed: case 'C':
0
390 if (modifier == 'E'
modifier == 'E'Description
TRUEnever evaluated
FALSEnever evaluated
)
0
391 {-
392 goto
never executed: goto underlying_strftime;
underlying_strftime;
never executed: goto underlying_strftime;
0
393-
394 }-
395-
396 {-
397 int century = tp->tm_year / 100 + 1900 / 100;-
398 century -= tp->tm_year % 100 < 0
tp->tm_year % 100 < 0Description
TRUEnever evaluated
FALSEnever evaluated
&& 0 < century
0 < centuryDescription
TRUEnever evaluated
FALSEnever evaluated
;
0
399 do { digits = 2; negative_number = tp->tm_year < - 1900; u_number_value = century; goto
never executed: goto do_signed_number;
do_signed_number;
never executed: goto do_signed_number;
} while (0);
0
400 }-
401-
402 case
executed 2 times by 1 test: case 'x':
Executed by:
  • date
'x':
executed 2 times by 1 test: case 'x':
Executed by:
  • date
2
403 if (modifier == 'O'
modifier == 'O'Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
)
0-2
404 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
405 goto
executed 2 times by 1 test: goto underlying_strftime;
Executed by:
  • date
underlying_strftime;
executed 2 times by 1 test: goto underlying_strftime;
Executed by:
  • date
2
406-
407 case
executed 8 times by 1 test: case 'D':
Executed by:
  • date
'D':
executed 8 times by 1 test: case 'D':
Executed by:
  • date
8
408 if (modifier != 0
modifier != 0Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • date
)
0-8
409 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
410 subfmt = "%m/%d/%y";-
411 goto
executed 8 times by 1 test: goto subformat;
Executed by:
  • date
subformat;
executed 8 times by 1 test: goto subformat;
Executed by:
  • date
8
412-
413 case
executed 2389 times by 5 tests: case 'd':
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
'd':
executed 2389 times by 5 tests: case 'd':
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
2389
414 if (modifier == 'E'
modifier == 'E'Description
TRUEnever evaluated
FALSEevaluated 2389 times by 5 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
)
0-2389
415 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
416-
417 do { digits = 2; number_value = tp->tm_mday; goto
executed 2389 times by 5 tests: goto do_number;
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
do_number;
executed 2389 times by 5 tests: goto do_number;
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
} while (0);
2389
418-
419 case
executed 164 times by 3 tests: case 'e':
Executed by:
  • date
  • ls
  • vdir
'e':
executed 164 times by 3 tests: case 'e':
Executed by:
  • date
  • ls
  • vdir
164
420 if (modifier == 'E'
modifier == 'E'Description
TRUEnever evaluated
FALSEevaluated 164 times by 3 tests
Evaluated by:
  • date
  • ls
  • vdir
)
0-164
421 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
422-
423 do { digits = 2; number_value = tp->tm_mday; goto
executed 164 times by 3 tests: goto do_number_spacepad;
Executed by:
  • date
  • ls
  • vdir
do_number_spacepad;
executed 164 times by 3 tests: goto do_number_spacepad;
Executed by:
  • date
  • ls
  • vdir
} while (0);
164
424-
425-
426-
427-
428 do_tz_offset:-
429 always_output_a_sign = -
430 1-
431 ;-
432 goto
executed 67 times by 5 tests: goto do_number_body;
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
do_number_body;
executed 67 times by 5 tests: goto do_number_body;
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
67
433-
434 do_number_spacepad:-
435-
436 if (pad != '0'
pad != '0'Description
TRUEevaluated 168 times by 3 tests
Evaluated by:
  • date
  • ls
  • vdir
FALSEnever evaluated
&& pad != '-'
pad != '-'Description
TRUEevaluated 168 times by 3 tests
Evaluated by:
  • date
  • ls
  • vdir
FALSEnever evaluated
)
0-168
437 pad = '_';
executed 168 times by 3 tests: pad = '_';
Executed by:
  • date
  • ls
  • vdir
168
438-
439 do_number:
code before this statement executed 168 times by 3 tests: do_number:
Executed by:
  • date
  • ls
  • vdir
168
440-
441 negative_number = number_value < 0;-
442 u_number_value = number_value;-
443-
444 do_signed_number:
code before this statement executed 10207 times by 6 tests: do_signed_number:
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
10207
445 always_output_a_sign = -
446 0-
447 ;-
448 tz_colon_mask = 0;-
449-
450 do_number_body:
code before this statement executed 15712 times by 6 tests: do_number_body:
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
15712
451-
452-
453-
454-
455-
456 if (modifier == 'O'
modifier == 'O'Description
TRUEnever evaluated
FALSEevaluated 15779 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
&& !negative_number
!negative_numberDescription
TRUEnever evaluated
FALSEnever evaluated
)
0-15779
457 {-
458 goto
never executed: goto underlying_strftime;
underlying_strftime;
never executed: goto underlying_strftime;
0
459-
460 }-
461-
462 bufp = buf + sizeof (buf) / sizeof (buf[0]);-
463-
464 if (negative_number
negative_numberDescription
TRUEevaluated 17 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
FALSEevaluated 15762 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
)
17-15762
465 u_number_value = - u_number_value;
executed 17 times by 3 tests: u_number_value = - u_number_value;
Executed by:
  • date
  • du
  • pr
17
466-
467 do-
468 {-
469 if (tz_colon_mask & 1
tz_colon_mask & 1Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • date
FALSEevaluated 28707 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
)
32-28707
470 *--
executed 32 times by 1 test: *--bufp = ':';
Executed by:
  • date
bufp = ':';
executed 32 times by 1 test: *--bufp = ':';
Executed by:
  • date
32
471 tz_colon_mask >>= 1;-
472 *--bufp = u_number_value % 10 + '0';-
473 u_number_value /= 10;-
474 }
executed 28739 times by 6 tests: end of block
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
28739
475 while (u_number_value != 0
u_number_value != 0Description
TRUEevaluated 12920 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
FALSEevaluated 15819 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
|| tz_colon_mask != 0
tz_colon_mask != 0Description
TRUEevaluated 40 times by 1 test
Evaluated by:
  • date
FALSEevaluated 15779 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
);
40-15819
476-
477 do_number_sign_and_padding:
code before this statement executed 15779 times by 6 tests: do_number_sign_and_padding:
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
15779
478 if (digits < width
digits < widthDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • date
FALSEevaluated 15782 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
)
12-15782
479 digits = width;
executed 12 times by 1 test: digits = width;
Executed by:
  • date
12
480-
481 sign_char = (negative_number
negative_numberDescription
TRUEevaluated 21 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
FALSEevaluated 15773 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
? '-'
21-15773
482 : always_output_a_sign
always_output_a_signDescription
TRUEevaluated 50 times by 5 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
FALSEevaluated 15723 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
? '+'
50-15723
483 : 0);-
484-
485 if (pad == '-'
pad == '-'Description
TRUEnever evaluated
FALSEevaluated 15794 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
)
0-15794
486 {-
487 if (sign_char
sign_charDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
488 do { size_t _n = (1); size_t _w = (width < 0
width < 0Description
TRUEnever evaluated
FALSEnever evaluated
? 0 : width); size_t _incr = _n < _w
_n < _wDescription
TRUEnever evaluated
FALSEnever evaluated
? _w : _n; if (_incr >= maxsize - i
_incr >= maxsize - iDescription
TRUEnever evaluated
FALSEnever evaluated
) return
never executed: return 0;
0;
never executed: return 0;
if (p
pDescription
TRUEnever evaluated
FALSEnever evaluated
) { if (digits == 0
digits == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& _n < _w
_n < _wDescription
TRUEnever evaluated
FALSEnever evaluated
) { size_t _delta = width - _n; if (pad == '0'
pad == '0'Description
TRUEnever evaluated
FALSEnever evaluated
) do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEnever evaluated
FALSEnever evaluated
; _i++) fputc ('0', p);
never executed: fputc ('0', p);
}
never executed: end of block
while (0); else do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEnever evaluated
FALSEnever evaluated
; _i++) fputc (' ', p);
never executed: fputc (' ', p);
}
never executed: end of block
while (0); } fputc (sign_char, p); ; }
never executed: end of block
i += _incr; }
never executed: end of block
while (0);
0
489 }
never executed: end of block
0
490 else-
491 {-
492 int padding = digits - (buf + (sizeof (buf) / sizeof (buf[0]))-
493 - bufp) - !!sign_char;-
494-
495 if (padding > 0
padding > 0Description
TRUEevaluated 9279 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
FALSEevaluated 6515 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
)
6515-9279
496 {-
497 if (pad == '_'
pad == '_'Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • date
FALSEevaluated 9269 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
)
10-9269
498 {-
499 if ((
(size_t) paddi...>= maxsize - iDescription
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • date
size_t) padding >= maxsize - i
(size_t) paddi...>= maxsize - iDescription
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • date
)
0-10
500 return
never executed: return 0;
0;
never executed: return 0;
0
501-
502 if (p
pDescription
TRUEevaluated 10 times by 1 test
Evaluated by:
  • date
FALSEnever evaluated
)
0-10
503 do { size_t _i; for (_i = 0; _i < padding
_i < paddingDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • date
FALSEevaluated 10 times by 1 test
Evaluated by:
  • date
; _i++) fputc (' ', p);
executed 14 times by 1 test: fputc (' ', p);
Executed by:
  • date
}
executed 10 times by 1 test: end of block
Executed by:
  • date
while (0);
10-14
504 i += padding;-
505 width = width > padding
width > paddingDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • date
FALSEevaluated 6 times by 1 test
Evaluated by:
  • date
? width - padding : 0;
4-6
506 if (sign_char
sign_charDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • date
FALSEevaluated 8 times by 1 test
Evaluated by:
  • date
)
2-8
507 do { size_t _n = (1); size_t _w = (width < 0
width < 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
? 0 : width); size_t _incr = _n < _w
_n < _wDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • date
FALSEnever evaluated
? _w : _n; if (_incr >= maxsize - i
_incr >= maxsize - iDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
) return
never executed: return 0;
0;
never executed: return 0;
if (p
pDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • date
FALSEnever evaluated
) { if (digits == 0
digits == 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
&& _n < _w
_n < _wDescription
TRUEnever evaluated
FALSEnever evaluated
) { size_t _delta = width - _n; if (pad == '0'
pad == '0'Description
TRUEnever evaluated
FALSEnever evaluated
) do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEnever evaluated
FALSEnever evaluated
; _i++) fputc ('0', p);
never executed: fputc ('0', p);
}
never executed: end of block
while (0); else do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEnever evaluated
FALSEnever evaluated
; _i++) fputc (' ', p);
never executed: fputc (' ', p);
}
never executed: end of block
while (0); } fputc (sign_char, p); ; }
executed 2 times by 1 test: end of block
Executed by:
  • date
i += _incr; }
executed 2 times by 1 test: end of block
Executed by:
  • date
while (0);
0-2
508 }
executed 10 times by 1 test: end of block
Executed by:
  • date
10
509 else-
510 {-
511 if ((
(size_t) digits >= maxsize - iDescription
TRUEnever evaluated
FALSEevaluated 9269 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
size_t) digits >= maxsize - i
(size_t) digits >= maxsize - iDescription
TRUEnever evaluated
FALSEevaluated 9269 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
)
0-9269
512 return
never executed: return 0;
0;
never executed: return 0;
0
513-
514 if (sign_char
sign_charDescription
TRUEevaluated 59 times by 5 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
FALSEevaluated 9210 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
)
59-9210
515 do { size_t _n = (1); size_t _w = (width < 0
width < 0Description
TRUEevaluated 34 times by 2 tests
Evaluated by:
  • date
  • du
FALSEevaluated 4 times by 1 test
Evaluated by:
  • date
? 0 : width); size_t _incr = _n < _w
_n < _wDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • date
FALSEevaluated 34 times by 2 tests
Evaluated by:
  • date
  • du
? _w : _n; if (_incr >= maxsize - i
_incr >= maxsize - iDescription
TRUEnever evaluated
FALSEevaluated 59 times by 5 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
) return
never executed: return 0;
0;
never executed: return 0;
if (p
pDescription
TRUEevaluated 56 times by 5 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
FALSEevaluated 3 times by 1 test
Evaluated by:
  • pr
) { if (digits == 0
digits == 0Description
TRUEnever evaluated
FALSEevaluated 56 times by 5 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
&& _n < _w
_n < _wDescription
TRUEnever evaluated
FALSEnever evaluated
) { size_t _delta = width - _n; if (pad == '0'
pad == '0'Description
TRUEnever evaluated
FALSEnever evaluated
) do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEevaluated 21 times by 3 tests
Evaluated by:
  • ls
  • pr
  • stat
FALSEnever evaluated
; _i++) fputc ('0', p);
never executed: fputc ('0', p);
}
never executed: end of block
while (0); else do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEnever evaluated
FALSEevaluated 21 times by 3 tests
Evaluated by:
  • ls
  • pr
  • stat
; _i++) fputc (' ', p);
executed 18 times by 3 tests: fputc (' ', p);
Executed by:
  • ls
  • pr
  • stat
}
executed 21 times by 3 tests: end of block
Executed by:
  • ls
  • pr
  • stat
while (0); } fputc (sign_char, p); ; }
executed 38 times by 2 tests: end of block
Executed by:
  • date
  • du
i += _incr; }
executed 38 times by 2 tests: end of block
Executed by:
  • date
  • du
while (0);
0-59
516-
517 if (p
pDescription
TRUEevaluated 9142 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
FALSEevaluated 127 times by 2 tests
Evaluated by:
  • date
  • pr
)
127-9142
518 do { size_t _i; for (_i = 0; _i < padding
_i < paddingDescription
TRUEevaluated 6476 times by 2 tests
Evaluated by:
  • date
  • du
FALSEevaluated 404 times by 2 tests
Evaluated by:
  • date
  • du
; _i++) fputc ('0', p);
executed 15214 times by 6 tests: fputc ('0', p);
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
}
executed 404 times by 2 tests: end of block
Executed by:
  • date
  • du
while (0);
404-15214
519 i += padding;-
520 width = 0;-
521 }
executed 9269 times by 6 tests: end of block
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
9269
522 }-
523 else-
524 {-
525 if (sign_char
sign_charDescription
TRUEevaluated 10 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
FALSEevaluated 6505 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
)
10-6505
526 do { size_t _n = (1); size_t _w = (width < 0
width < 0Description
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • date
  • du
FALSEnever evaluated
? 0 : width); size_t _incr = _n < _w
_n < _wDescription
TRUEnever evaluated
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • date
  • du
? _w : _n; if (_incr >= maxsize - i
_incr >= maxsize - iDescription
TRUEnever evaluated
FALSEevaluated 10 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
) return
never executed: return 0;
0;
never executed: return 0;
if (p
pDescription
TRUEevaluated 9 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
FALSEevaluated 1 time by 1 test
Evaluated by:
  • pr
) { if (digits == 0
digits == 0Description
TRUEnever evaluated
FALSEevaluated 9 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
&& _n < _w
_n < _wDescription
TRUEnever evaluated
FALSEnever evaluated
) { size_t _delta = width - _n; if (pad == '0'
pad == '0'Description
TRUEnever evaluated
FALSEnever evaluated
) do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • pr
FALSEnever evaluated
; _i++) fputc ('0', p);
never executed: fputc ('0', p);
}
never executed: end of block
while (0); else do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • pr
; _i++) fputc (' ', p);
executed 1 time by 1 test: fputc (' ', p);
Executed by:
  • pr
}
executed 2 times by 1 test: end of block
Executed by:
  • pr
while (0); } fputc (sign_char, p); ; }
executed 8 times by 2 tests: end of block
Executed by:
  • date
  • du
i += _incr; }
executed 8 times by 2 tests: end of block
Executed by:
  • date
  • du
while (0);
0-10
527 }
executed 6515 times by 6 tests: end of block
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
6515
528 }-
529-
530 do { size_t _n = ((buf + sizeof (buf) / sizeof (buf[0]) - bufp)); size_t _w = (width < 0
width < 0Description
TRUEevaluated 1325 times by 2 tests
Evaluated by:
  • date
  • du
FALSEevaluated 530 times by 2 tests
Evaluated by:
  • date
  • du
? 0 : width); size_t _incr = _n < _w
_n < _wDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • date
FALSEevaluated 1853 times by 2 tests
Evaluated by:
  • date
  • du
? _w : _n; if (_incr >= maxsize - i
_incr >= maxsize - iDescription
TRUEnever evaluated
FALSEevaluated 15794 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
) return
never executed: return 0;
0;
never executed: return 0;
if (p
pDescription
TRUEevaluated 15494 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
FALSEevaluated 300 times by 2 tests
Evaluated by:
  • date
  • pr
) { if (digits == 0
digits == 0Description
TRUEnever evaluated
FALSEevaluated 15494 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
&& _n < _w
_n < _wDescription
TRUEnever evaluated
FALSEnever evaluated
) { size_t _delta = width - _n; if (pad == '0'
pad == '0'Description
TRUEnever evaluated
FALSEnever evaluated
) do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEevaluated 5174 times by 5 tests
Evaluated by:
  • date
  • ls
  • pr
  • stat
  • vdir
FALSEevaluated 8765 times by 5 tests
Evaluated by:
  • date
  • ls
  • pr
  • stat
  • vdir
; _i++) fputc ('0', p);
never executed: fputc ('0', p);
}
never executed: end of block
while (0); else do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEnever evaluated
FALSEevaluated 13939 times by 5 tests
Evaluated by:
  • date
  • ls
  • pr
  • stat
  • vdir
; _i++) fputc (' ', p);
never executed: fputc (' ', p);
}
never executed: end of block
while (0); } do { if (to_lowcase
to_lowcaseDescription
TRUEnever evaluated
FALSEevaluated 15494 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
) fwrite_lowcase (p, (bufp), _n);
executed 13891 times by 5 tests: fwrite_lowcase (p, (bufp), _n);
Executed by:
  • date
  • ls
  • pr
  • stat
  • vdir
else if (to_uppcase
to_uppcaseDescription
TRUEnever evaluated
FALSEevaluated 15494 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
) fwrite_uppcase (p, (bufp), _n);
executed 13891 times by 5 tests: fwrite_uppcase (p, (bufp), _n);
Executed by:
  • date
  • ls
  • pr
  • stat
  • vdir
else { fwrite (bufp, _n, 1, p); }
executed 1603 times by 2 tests: end of block
Executed by:
  • date
  • du
} while (0); ; }
executed 1603 times by 2 tests: end of block
Executed by:
  • date
  • du
i += _incr; } while (0);
0-15794
531 break;
executed 15794 times by 6 tests: break;
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
15794
532-
533 case
executed 6 times by 1 test: case 'F':
Executed by:
  • date
'F':
executed 6 times by 1 test: case 'F':
Executed by:
  • date
6
534 if (modifier != 0
modifier != 0Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • date
)
0-6
535 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
536 subfmt = "%Y-%m-%d";-
537 goto
executed 6 times by 1 test: goto subformat;
Executed by:
  • date
subformat;
executed 6 times by 1 test: goto subformat;
Executed by:
  • date
6
538-
539 case
executed 2578 times by 6 tests: case 'H':
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
'H':
executed 2578 times by 6 tests: case 'H':
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
2578
540 if (modifier == 'E'
modifier == 'E'Description
TRUEnever evaluated
FALSEevaluated 2578 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
)
0-2578
541 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
542-
543 do { digits = 2; number_value = tp->tm_hour; goto
executed 2578 times by 6 tests: goto do_number;
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
do_number;
executed 2578 times by 6 tests: goto do_number;
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
} while (0);
2578
544-
545 case
executed 2 times by 1 test: case 'I':
Executed by:
  • date
'I':
executed 2 times by 1 test: case 'I':
Executed by:
  • date
2
546 if (modifier == 'E'
modifier == 'E'Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
)
0-2
547 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
548-
549 do { digits = 2; number_value = hour12; goto
executed 2 times by 1 test: goto do_number;
Executed by:
  • date
do_number;
executed 2 times by 1 test: goto do_number;
Executed by:
  • date
} while (0);
2
550-
551 case
executed 2 times by 1 test: case 'k':
Executed by:
  • date
'k':
executed 2 times by 1 test: case 'k':
Executed by:
  • date
2
552 if (modifier == 'E'
modifier == 'E'Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
)
0-2
553 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
554-
555 do { digits = 2; number_value = tp->tm_hour; goto
executed 2 times by 1 test: goto do_number_spacepad;
Executed by:
  • date
do_number_spacepad;
executed 2 times by 1 test: goto do_number_spacepad;
Executed by:
  • date
} while (0);
2
556-
557 case
executed 2 times by 1 test: case 'l':
Executed by:
  • date
'l':
executed 2 times by 1 test: case 'l':
Executed by:
  • date
2
558 if (modifier == 'E'
modifier == 'E'Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
)
0-2
559 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
560-
561 do { digits = 2; number_value = hour12; goto
executed 2 times by 1 test: goto do_number_spacepad;
Executed by:
  • date
do_number_spacepad;
executed 2 times by 1 test: goto do_number_spacepad;
Executed by:
  • date
} while (0);
2
562-
563 case
executed 2 times by 1 test: case 'j':
Executed by:
  • date
'j':
executed 2 times by 1 test: case 'j':
Executed by:
  • date
2
564 if (modifier == 'E'
modifier == 'E'Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
)
0-2
565 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
566-
567 do { digits = 3; negative_number = tp->tm_yday < -1; u_number_value = tp->tm_yday + 1U; goto
executed 2 times by 1 test: goto do_signed_number;
Executed by:
  • date
do_signed_number;
executed 2 times by 1 test: goto do_signed_number;
Executed by:
  • date
} while (0);
2
568-
569 case
executed 2576 times by 6 tests: case 'M':
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
'M':
executed 2576 times by 6 tests: case 'M':
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
2576
570 if (modifier == 'E'
modifier == 'E'Description
TRUEnever evaluated
FALSEevaluated 2576 times by 6 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
)
0-2576
571 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
572-
573 do { digits = 2; number_value = tp->tm_min; goto
executed 2576 times by 6 tests: goto do_number;
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
do_number;
executed 2576 times by 6 tests: goto do_number;
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
} while (0);
2576
574-
575 case
executed 2382 times by 5 tests: case 'm':
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
'm':
executed 2382 times by 5 tests: case 'm':
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
2382
576 if (modifier == 'E'
modifier == 'E'Description
TRUEnever evaluated
FALSEevaluated 2382 times by 5 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
)
0-2382
577 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
578-
579 do { digits = 2; negative_number = tp->tm_mon < -1; u_number_value = tp->tm_mon + 1U; goto
executed 2382 times by 5 tests: goto do_signed_number;
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
do_signed_number;
executed 2382 times by 5 tests: goto do_signed_number;
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
} while (0);
2382
580-
581-
582 case
executed 31 times by 4 tests: case 'N':
Executed by:
  • date
  • du
  • ls
  • stat
'N':
executed 31 times by 4 tests: case 'N':
Executed by:
  • date
  • du
  • ls
  • stat
31
583 if (modifier == 'E'
modifier == 'E'Description
TRUEnever evaluated
FALSEevaluated 31 times by 4 tests
Evaluated by:
  • date
  • du
  • ls
  • stat
)
0-31
584 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
585-
586 number_value = ns;-
587 if (width == -1
width == -1Description
TRUEevaluated 31 times by 4 tests
Evaluated by:
  • date
  • du
  • ls
  • stat
FALSEnever evaluated
)
0-31
588 width = 9;
executed 31 times by 4 tests: width = 9;
Executed by:
  • date
  • du
  • ls
  • stat
31
589 else-
590 {-
591-
592 int j;-
593 for (j = width; j < 9
j < 9Description
TRUEnever evaluated
FALSEnever evaluated
; j++)
0
594 number_value /= 10;
never executed: number_value /= 10;
0
595 }
never executed: end of block
0
596-
597 do { digits = width; number_value = number_value; goto
executed 31 times by 4 tests: goto do_number;
Executed by:
  • date
  • du
  • ls
  • stat
do_number;
executed 31 times by 4 tests: goto do_number;
Executed by:
  • date
  • du
  • ls
  • stat
} while (0);
31
598-
599-
600 case
executed 2 times by 1 test: case 'n':
Executed by:
  • date
'n':
executed 2 times by 1 test: case 'n':
Executed by:
  • date
2
601 do { size_t _n = (1); size_t _w = (width < 0
width < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • date
FALSEnever evaluated
? 0 : width); size_t _incr = _n < _w
_n < _wDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
? _w : _n; if (_incr >= maxsize - i
_incr >= maxsize - iDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
) return
never executed: return 0;
0;
never executed: return 0;
if (p
pDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • date
FALSEnever evaluated
) { if (digits == 0
digits == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • date
FALSEnever evaluated
&& _n < _w
_n < _wDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
) { size_t _delta = width - _n; if (pad == '0'
pad == '0'Description
TRUEnever evaluated
FALSEnever evaluated
) do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEnever evaluated
FALSEnever evaluated
; _i++) fputc ('0', p);
never executed: fputc ('0', p);
}
never executed: end of block
while (0); else do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEnever evaluated
FALSEnever evaluated
; _i++) fputc (' ', p);
never executed: fputc (' ', p);
}
never executed: end of block
while (0); } fputc ('\n', p); ; }
executed 2 times by 1 test: end of block
Executed by:
  • date
i += _incr; } while (0);
0-2
602 break;
executed 2 times by 1 test: break;
Executed by:
  • date
2
603-
604 case
never executed: case 'P':
'P':
never executed: case 'P':
0
605 to_lowcase = -
606 1-
607 ;-
608-
609 format_char = 'p';-
610-
611 ((void) 0);-
612 case
executed 2 times by 1 test: case 'p':
Executed by:
  • date
code before this statement never executed: case 'p':
executed 2 times by 1 test: case 'p':
Executed by:
  • date
'p':
code before this statement never executed: case 'p':
executed 2 times by 1 test: case 'p':
Executed by:
  • date
0-2
613 if (change_case
change_caseDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
)
0-2
614 {-
615 to_uppcase = -
616 0-
617 ;-
618 to_lowcase = -
619 1-
620 ;-
621 }
never executed: end of block
0
622-
623-
624-
625-
626 goto
executed 2 times by 1 test: goto underlying_strftime;
Executed by:
  • date
underlying_strftime;
executed 2 times by 1 test: goto underlying_strftime;
Executed by:
  • date
2
627-
628-
629 case
executed 8 times by 1 test: case 'q':
Executed by:
  • date
'q':
executed 8 times by 1 test: case 'q':
Executed by:
  • date
8
630 do { digits = 1; negative_number = -
631 0-
632 ; u_number_value = ((tp->tm_mon * 11) >> 5) + 1; goto
executed 8 times by 1 test: goto do_signed_number;
Executed by:
  • date
do_signed_number;
executed 8 times by 1 test: goto do_signed_number;
Executed by:
  • date
} while (0);
8
633 break;
dead code: break;
-
634-
635 case
never executed: case 'R':
'R':
never executed: case 'R':
0
636 subfmt = "%H:%M";-
637 goto
never executed: goto subformat;
subformat;
never executed: goto subformat;
0
638-
639 case
executed 2 times by 1 test: case 'r':
Executed by:
  • date
'r':
executed 2 times by 1 test: case 'r':
Executed by:
  • date
2
640-
641-
642-
643-
644-
645-
646-
647 goto
executed 2 times by 1 test: goto underlying_strftime;
Executed by:
  • date
underlying_strftime;
executed 2 times by 1 test: goto underlying_strftime;
Executed by:
  • date
2
648-
649-
650 case
executed 2413 times by 5 tests: case 'S':
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
'S':
executed 2413 times by 5 tests: case 'S':
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
2413
651 if (modifier == 'E'
modifier == 'E'Description
TRUEnever evaluated
FALSEevaluated 2413 times by 5 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
)
0-2413
652 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
653-
654 do { digits = 2; number_value = tp->tm_sec; goto
executed 2413 times by 5 tests: goto do_number;
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
do_number;
executed 2413 times by 5 tests: goto do_number;
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
} while (0);
2413
655-
656 case
executed 15 times by 1 test: case 's':
Executed by:
  • date
's':
executed 15 times by 1 test: case 's':
Executed by:
  • date
15
657 {-
658 struct tm ltm;-
659 time_t t;-
660-
661 ltm = *tp;-
662 t = mktime_z (tz, &ltm);-
663-
664-
665-
666-
667 bufp = buf + sizeof (buf) / sizeof (buf[0]);-
668 negative_number = t < 0;-
669-
670 do-
671 {-
672 int d = t % 10;-
673 t /= 10;-
674 *--bufp = (negative_number
negative_numberDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • date
FALSEevaluated 82 times by 1 test
Evaluated by:
  • date
? -d : d) + '0';
8-82
675 }
executed 90 times by 1 test: end of block
Executed by:
  • date
90
676 while (t != 0
t != 0Description
TRUEevaluated 75 times by 1 test
Evaluated by:
  • date
FALSEevaluated 15 times by 1 test
Evaluated by:
  • date
);
15-75
677-
678 digits = 1;-
679 always_output_a_sign = -
680 0-
681 ;-
682 goto
executed 15 times by 1 test: goto do_number_sign_and_padding;
Executed by:
  • date
do_number_sign_and_padding;
executed 15 times by 1 test: goto do_number_sign_and_padding;
Executed by:
  • date
15
683 }-
684-
685 case
executed 2 times by 1 test: case 'X':
Executed by:
  • date
'X':
executed 2 times by 1 test: case 'X':
Executed by:
  • date
2
686 if (modifier == 'O'
modifier == 'O'Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
)
0-2
687 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
688 goto
executed 2 times by 1 test: goto underlying_strftime;
Executed by:
  • date
underlying_strftime;
executed 2 times by 1 test: goto underlying_strftime;
Executed by:
  • date
2
689-
690 case
executed 70 times by 1 test: case 'T':
Executed by:
  • date
'T':
executed 70 times by 1 test: case 'T':
Executed by:
  • date
70
691 subfmt = "%H:%M:%S";-
692 goto
executed 70 times by 1 test: goto subformat;
Executed by:
  • date
subformat;
executed 70 times by 1 test: goto subformat;
Executed by:
  • date
70
693-
694 case
executed 2 times by 1 test: case 't':
Executed by:
  • date
't':
executed 2 times by 1 test: case 't':
Executed by:
  • date
2
695 do { size_t _n = (1); size_t _w = (width < 0
width < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • date
FALSEnever evaluated
? 0 : width); size_t _incr = _n < _w
_n < _wDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
? _w : _n; if (_incr >= maxsize - i
_incr >= maxsize - iDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
) return
never executed: return 0;
0;
never executed: return 0;
if (p
pDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • date
FALSEnever evaluated
) { if (digits == 0
digits == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • date
FALSEnever evaluated
&& _n < _w
_n < _wDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
) { size_t _delta = width - _n; if (pad == '0'
pad == '0'Description
TRUEnever evaluated
FALSEnever evaluated
) do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEnever evaluated
FALSEnever evaluated
; _i++) fputc ('0', p);
never executed: fputc ('0', p);
}
never executed: end of block
while (0); else do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEnever evaluated
FALSEnever evaluated
; _i++) fputc (' ', p);
never executed: fputc (' ', p);
}
never executed: end of block
while (0); } fputc ('\t', p); ; }
executed 2 times by 1 test: end of block
Executed by:
  • date
i += _incr; } while (0);
0-2
696 break;
executed 2 times by 1 test: break;
Executed by:
  • date
2
697-
698 case
never executed: case 'u':
'u':
never executed: case 'u':
0
699 do { digits = 1; number_value = (tp->tm_wday - 1 + 7) % 7 + 1; goto
never executed: goto do_number;
do_number;
never executed: goto do_number;
} while (0);
0
700-
701 case
executed 14 times by 1 test: case 'U':
Executed by:
  • date
'U':
executed 14 times by 1 test: case 'U':
Executed by:
  • date
14
702 if (modifier == 'E'
modifier == 'E'Description
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • date
)
0-14
703 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
704-
705 do { digits = 2; number_value = (tp->tm_yday - tp->tm_wday + 7) / 7; goto
executed 14 times by 1 test: goto do_number;
Executed by:
  • date
do_number;
executed 14 times by 1 test: goto do_number;
Executed by:
  • date
} while (0);
14
706-
707 case
executed 8 times by 1 test: case 'V':
Executed by:
  • date
'V':
executed 8 times by 1 test: case 'V':
Executed by:
  • date
8
708 case
never executed: case 'g':
'g':
never executed: case 'g':
0
709 case
never executed: case 'G':
'G':
never executed: case 'G':
0
710 if (modifier == 'E'
modifier == 'E'Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • date
)
0-8
711 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
712 {-
713-
714-
715-
716-
717 int year = (tp->tm_year-
718 + (tp->tm_year < 0
tp->tm_year < 0Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • date
0-8
719 ? 1900 % 400-
720 : 1900 % 400 - 400));-
721 int year_adjust = 0;-
722 int days = iso_week_days (tp->tm_yday, tp->tm_wday);-
723-
724 if (days < 0
days < 0Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • date
)
0-8
725 {-
726-
727 year_adjust = -1;-
728 days = iso_week_days (tp->tm_yday + (365 + -
729 ((-
730 year - 1-
731 ) % 4 == 0 && ((-
732 year - 1-
733 ) % 100 != 0 || (-
734 year - 1-
735 ) % 400 == 0))-
736 ),-
737 tp->tm_wday);-
738 }
never executed: end of block
0
739 else-
740 {-
741 int d = iso_week_days (tp->tm_yday - (365 + -
742 ((-
743 year-
744 ) % 4 == 0 && ((-
745 year-
746 ) % 100 != 0 || (-
747 year-
748 ) % 400 == 0))-
749 ),-
750 tp->tm_wday);-
751 if (0 <= d
0 <= dDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • date
)
0-8
752 {-
753-
754 year_adjust = 1;-
755 days = d;-
756 }
never executed: end of block
0
757 }
executed 8 times by 1 test: end of block
Executed by:
  • date
8
758-
759 switch (*f)-
760 {-
761 case
never executed: case 'g':
'g':
never executed: case 'g':
0
762 {-
763 int yy = (tp->tm_year % 100 + year_adjust) % 100;-
764 do { digits = 2; number_value = (0 <= yy
0 <= yyDescription
TRUEnever evaluated
FALSEnever evaluated
? yy : tp->tm_year < -1900 - year_adjust
tp->tm_year < ... - year_adjustDescription
TRUEnever evaluated
FALSEnever evaluated
? -yy : yy + 100); goto
never executed: goto do_number;
do_number;
never executed: goto do_number;
} while (0)
0
765-
766-
767-
768 ;-
769 }-
770-
771 case
never executed: case 'G':
'G':
never executed: case 'G':
0
772 do { digits = 4; negative_number = tp->tm_year < -1900 - year_adjust; u_number_value = (tp->tm_year + (unsigned int) 1900 + year_adjust); goto
never executed: goto do_signed_number;
do_signed_number;
never executed: goto do_signed_number;
} while (0)
0
773-
774 ;-
775-
776 default
executed 8 times by 1 test: default:
Executed by:
  • date
:
executed 8 times by 1 test: default:
Executed by:
  • date
8
777 do { digits = 2; number_value = days / 7 + 1; goto
executed 8 times by 1 test: goto do_number;
Executed by:
  • date
do_number;
executed 8 times by 1 test: goto do_number;
Executed by:
  • date
} while (0);
8
778 }-
779 }-
780-
781 case
executed 8 times by 1 test: case 'W':
Executed by:
  • date
code before this statement never executed: case 'W':
executed 8 times by 1 test: case 'W':
Executed by:
  • date
'W':
code before this statement never executed: case 'W':
executed 8 times by 1 test: case 'W':
Executed by:
  • date
0-8
782 if (modifier == 'E'
modifier == 'E'Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • date
)
0-8
783 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
784-
785 do { digits = 2; number_value = (tp->tm_yday - (tp->tm_wday - 1 + 7) % 7 + 7) / 7; goto
executed 8 times by 1 test: goto do_number;
Executed by:
  • date
do_number;
executed 8 times by 1 test: goto do_number;
Executed by:
  • date
} while (0);
8
786-
787 case
executed 2 times by 1 test: case 'w':
Executed by:
  • date
'w':
executed 2 times by 1 test: case 'w':
Executed by:
  • date
2
788 if (modifier == 'E'
modifier == 'E'Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
)
0-2
789 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
790-
791 do { digits = 1; number_value = tp->tm_wday; goto
executed 2 times by 1 test: goto do_number;
Executed by:
  • date
do_number;
executed 2 times by 1 test: goto do_number;
Executed by:
  • date
} while (0);
2
792-
793 case
executed 3113 times by 5 tests: case 'Y':
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
'Y':
executed 3113 times by 5 tests: case 'Y':
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
3113
794 if (modifier == 'E'
modifier == 'E'Description
TRUEnever evaluated
FALSEevaluated 3113 times by 5 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
)
0-3113
795 {-
796 goto
never executed: goto underlying_strftime;
underlying_strftime;
never executed: goto underlying_strftime;
0
797-
798 }-
799 if (modifier == 'O'
modifier == 'O'Description
TRUEnever evaluated
FALSEevaluated 3113 times by 5 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
)
0-3113
800 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
801-
802 do { digits = 4; negative_number = tp->tm_year < -1900; u_number_value = tp->tm_year + (unsigned int) 1900; goto
executed 3113 times by 5 tests: goto do_signed_number;
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
do_signed_number;
executed 3113 times by 5 tests: goto do_signed_number;
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
} while (0)
3113
803 ;-
804-
805 case
executed 18 times by 1 test: case 'y':
Executed by:
  • date
'y':
executed 18 times by 1 test: case 'y':
Executed by:
  • date
18
806 if (modifier == 'E'
modifier == 'E'Description
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • date
)
0-18
807 {-
808 goto
never executed: goto underlying_strftime;
underlying_strftime;
never executed: goto underlying_strftime;
0
809-
810 }-
811-
812 {-
813 int yy = tp->tm_year % 100;-
814 if (yy < 0
yy < 0Description
TRUEnever evaluated
FALSEevaluated 18 times by 1 test
Evaluated by:
  • date
)
0-18
815 yy = tp->tm_year < - 1900
tp->tm_year < - 1900Description
TRUEnever evaluated
FALSEnever evaluated
? -yy : yy + 100;
never executed: yy = tp->tm_year < - 1900 ? -yy : yy + 100;
0
816 do { digits = 2; number_value = yy; goto
executed 18 times by 1 test: goto do_number;
Executed by:
  • date
do_number;
executed 18 times by 1 test: goto do_number;
Executed by:
  • date
} while (0);
18
817 }-
818-
819 case
executed 25 times by 3 tests: case 'Z':
Executed by:
  • date
  • du
  • pr
'Z':
executed 25 times by 3 tests: case 'Z':
Executed by:
  • date
  • du
  • pr
25
820 if (change_case
change_caseDescription
TRUEnever evaluated
FALSEevaluated 25 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
)
0-25
821 {-
822 to_uppcase = -
823 0-
824 ;-
825 to_lowcase = -
826 1-
827 ;-
828 }
never executed: end of block
0
829 do { size_t _n = ((strlen (zone))); size_t _w = (width < 0
width < 0Description
TRUEevaluated 17 times by 2 tests
Evaluated by:
  • date
  • du
FALSEnever evaluated
? 0 : width); size_t _incr = _n < _w
_n < _wDescription
TRUEnever evaluated
FALSEevaluated 17 times by 2 tests
Evaluated by:
  • date
  • du
? _w : _n; if (_incr >= maxsize - i
_incr >= maxsize - iDescription
TRUEnever evaluated
FALSEevaluated 25 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
) return
never executed: return 0;
0;
never executed: return 0;
if (p
pDescription
TRUEevaluated 21 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
FALSEevaluated 4 times by 1 test
Evaluated by:
  • pr
) { if (digits == 0
digits == 0Description
TRUEevaluated 21 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
FALSEnever evaluated
&& _n < _w
_n < _wDescription
TRUEnever evaluated
FALSEevaluated 21 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
) { size_t _delta = width - _n; if (pad == '0'
pad == '0'Description
TRUEnever evaluated
FALSEnever evaluated
) do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • pr
FALSEnever evaluated
; _i++) fputc ('0', p);
never executed: fputc ('0', p);
}
never executed: end of block
while (0); else do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • pr
; _i++) fputc (' ', p);
never executed: fputc (' ', p);
}
never executed: end of block
while (0); } do { if (to_lowcase
to_lowcaseDescription
TRUEnever evaluated
FALSEevaluated 21 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
) fwrite_lowcase (p, (zone), _n);
executed 4 times by 1 test: fwrite_lowcase (p, (zone), _n);
Executed by:
  • pr
else if (to_uppcase
to_uppcaseDescription
TRUEnever evaluated
FALSEevaluated 21 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
) fwrite_uppcase (p, (zone), _n);
executed 4 times by 1 test: fwrite_uppcase (p, (zone), _n);
Executed by:
  • pr
else { fwrite (zone, _n, 1, p); }
executed 17 times by 2 tests: end of block
Executed by:
  • date
  • du
} while (0); ; }
executed 17 times by 2 tests: end of block
Executed by:
  • date
  • du
i += _incr; } while (0);
0-25
830-
831 break;
executed 25 times by 3 tests: break;
Executed by:
  • date
  • du
  • pr
25
832-
833 case
executed 30 times by 1 test: case ':':
Executed by:
  • date
':':
executed 30 times by 1 test: case ':':
Executed by:
  • date
30
834-
835-
836 for (colons = 1; f[colons] == ':'
f[colons] == ':'Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • date
FALSEevaluated 30 times by 1 test
Evaluated by:
  • date
; colons++)
14-30
837 continue;
executed 14 times by 1 test: continue;
Executed by:
  • date
14
838 if (f[colons] != 'z'
f[colons] != 'z'Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • date
FALSEevaluated 28 times by 1 test
Evaluated by:
  • date
)
2-28
839 goto
executed 2 times by 1 test: goto bad_format;
Executed by:
  • date
bad_format;
executed 2 times by 1 test: goto bad_format;
Executed by:
  • date
2
840 f += colons;-
841 goto
executed 28 times by 1 test: goto do_z_conversion;
Executed by:
  • date
do_z_conversion;
executed 28 times by 1 test: goto do_z_conversion;
Executed by:
  • date
28
842-
843 case
executed 39 times by 5 tests: case 'z':
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
'z':
executed 39 times by 5 tests: case 'z':
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
39
844 colons = 0;-
845-
846 do_z_conversion:
code before this statement executed 39 times by 5 tests: do_z_conversion:
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
39
847 if (tp->tm_isdst < 0
tp->tm_isdst < 0Description
TRUEnever evaluated
FALSEevaluated 67 times by 5 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
)
0-67
848 break;
never executed: break;
0
849-
850 {-
851 int diff;-
852 int hour_diff;-
853 int min_diff;-
854 int sec_diff;-
855-
856 diff = tp->tm_gmtoff;-
857 negative_number = diff < 0
diff < 0Description
TRUEevaluated 17 times by 3 tests
Evaluated by:
  • date
  • du
  • pr
FALSEevaluated 50 times by 5 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
  • stat
|| (diff == 0
diff == 0Description
TRUEevaluated 27 times by 4 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
FALSEevaluated 23 times by 4 tests
Evaluated by:
  • date
  • du
  • pr
  • stat
&& *
*zone == '-'Description
TRUEnever evaluated
FALSEevaluated 27 times by 4 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
zone == '-'
*zone == '-'Description
TRUEnever evaluated
FALSEevaluated 27 times by 4 tests
Evaluated by:
  • date
  • du
  • ls
  • pr
);
0-50
858 hour_diff = diff / 60 / 60;-
859 min_diff = diff / 60 % 60;-
860 sec_diff = diff % 60;-
861-
862 switch (colons)-
863 {-
864 case
executed 39 times by 5 tests: case 0:
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
0:
executed 39 times by 5 tests: case 0:
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
39
865 do { digits = 5; tz_colon_mask = 0; u_number_value = hour_diff * 100 + min_diff; goto
executed 39 times by 5 tests: goto do_tz_offset;
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
do_tz_offset;
executed 39 times by 5 tests: goto do_tz_offset;
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
} while (0);
39
866-
867 case
executed 20 times by 1 test: case 1:
Executed by:
  • date
1:
executed 20 times by 1 test: case 1:
Executed by:
  • date
tz_hh_mm:
20
868 do { digits = 6; tz_colon_mask = 04; u_number_value = hour_diff * 100 + min_diff; goto
executed 20 times by 1 test: goto do_tz_offset;
Executed by:
  • date
do_tz_offset;
executed 20 times by 1 test: goto do_tz_offset;
Executed by:
  • date
} while (0);
20
869-
870 case
executed 2 times by 1 test: case 2:
Executed by:
  • date
2:
executed 2 times by 1 test: case 2:
Executed by:
  • date
tz_hh_mm_ss:
2
871 do { digits = 9; tz_colon_mask = 024; u_number_value = hour_diff * 10000 + min_diff * 100 + sec_diff; goto
executed 6 times by 1 test: goto do_tz_offset;
Executed by:
  • date
do_tz_offset;
executed 6 times by 1 test: goto do_tz_offset;
Executed by:
  • date
} while (0)
6
872 ;-
873-
874 case
executed 6 times by 1 test: case 3:
Executed by:
  • date
3:
executed 6 times by 1 test: case 3:
Executed by:
  • date
6
875 if (sec_diff != 0
sec_diff != 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • date
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
)
2-4
876 goto
executed 4 times by 1 test: goto tz_hh_mm_ss;
Executed by:
  • date
tz_hh_mm_ss;
executed 4 times by 1 test: goto tz_hh_mm_ss;
Executed by:
  • date
4
877 if (min_diff != 0
min_diff != 0Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
)
0-2
878 goto
never executed: goto tz_hh_mm;
tz_hh_mm;
never executed: goto tz_hh_mm;
0
879 do { digits = 3; tz_colon_mask = 0; u_number_value = hour_diff; goto
executed 2 times by 1 test: goto do_tz_offset;
Executed by:
  • date
do_tz_offset;
executed 2 times by 1 test: goto do_tz_offset;
Executed by:
  • date
} while (0);
2
880-
881 default
never executed: default:
:
never executed: default:
0
882 goto
never executed: goto bad_format;
bad_format;
never executed: goto bad_format;
0
883 }-
884 }-
885-
886 case
never executed: case '\0':
'\0':
never executed: case '\0':
code before this statement never executed: case '\0':
0
887 --f;-
888 ((void) 0);-
889 default
never executed: default:
:
never executed: default:
code before this statement never executed: default:
0
890-
891-
892-
893 bad_format:-
894 {-
895 int flen;-
896 for (flen = 1; f[1 - flen] != '%'
f[1 - flen] != '%'Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • date
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
; flen++)
2
897 continue;
executed 2 times by 1 test: continue;
Executed by:
  • date
2
898 do { size_t _n = ((flen)); size_t _w = (width < 0
width < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • date
FALSEnever evaluated
? 0 : width); size_t _incr = _n < _w
_n < _wDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
? _w : _n; if (_incr >= maxsize - i
_incr >= maxsize - iDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
) return
never executed: return 0;
0;
never executed: return 0;
if (p
pDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • date
FALSEnever evaluated
) { if (digits == 0
digits == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • date
FALSEnever evaluated
&& _n < _w
_n < _wDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
) { size_t _delta = width - _n; if (pad == '0'
pad == '0'Description
TRUEnever evaluated
FALSEnever evaluated
) do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEnever evaluated
FALSEnever evaluated
; _i++) fputc ('0', p);
never executed: fputc ('0', p);
}
never executed: end of block
while (0); else do { size_t _i; for (_i = 0; _i < _delta
_i < _deltaDescription
TRUEnever evaluated
FALSEnever evaluated
; _i++) fputc (' ', p);
never executed: fputc (' ', p);
}
never executed: end of block
while (0); } do { if (to_lowcase
to_lowcaseDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
) fwrite_lowcase (p, (&f[1 - flen]), _n);
never executed: fwrite_lowcase (p, (&f[1 - flen]), _n);
else if (to_uppcase
to_uppcaseDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • date
) fwrite_uppcase (p, (&f[1 - flen]), _n);
never executed: fwrite_uppcase (p, (&f[1 - flen]), _n);
else { fwrite (&f[1 - flen], _n, 1, p); }
executed 2 times by 1 test: end of block
Executed by:
  • date
} while (0); ; }
executed 2 times by 1 test: end of block
Executed by:
  • date
i += _incr; } while (0);
0-2
899 }-
900 break;
executed 2 times by 1 test: break;
Executed by:
  • date
2
901 }-
902 }-
903-
904-
905-
906-
907-
908-
909 return
executed 4964 times by 6 tests: return i;
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
i;
executed 4964 times by 6 tests: return i;
Executed by:
  • date
  • du
  • ls
  • pr
  • stat
  • vdir
4964
910}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2