Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/asn1/a_mbstr.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||
2 | static int traverse_string(const unsigned char *p, int len, int inform, | - | ||||||||||||||||||||||||
3 | int (*rfunc) (unsigned long value, void *in), | - | ||||||||||||||||||||||||
4 | void *arg); | - | ||||||||||||||||||||||||
5 | static int in_utf8(unsigned long value, void *arg); | - | ||||||||||||||||||||||||
6 | static int out_utf8(unsigned long value, void *arg); | - | ||||||||||||||||||||||||
7 | static int type_str(unsigned long value, void *arg); | - | ||||||||||||||||||||||||
8 | static int cpy_asc(unsigned long value, void *arg); | - | ||||||||||||||||||||||||
9 | static int cpy_bmp(unsigned long value, void *arg); | - | ||||||||||||||||||||||||
10 | static int cpy_univ(unsigned long value, void *arg); | - | ||||||||||||||||||||||||
11 | static int cpy_utf8(unsigned long value, void *arg); | - | ||||||||||||||||||||||||
12 | int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len, | - | ||||||||||||||||||||||||
13 | int inform, unsigned long mask) | - | ||||||||||||||||||||||||
14 | { | - | ||||||||||||||||||||||||
15 | return executed 154154 times by 1 test: ASN1_mbstring_ncopy(out, in, len, inform, mask, 0, 0);return ASN1_mbstring_ncopy(out, in, len, inform, mask, 0, 0); Executed by:
executed 154154 times by 1 test: return ASN1_mbstring_ncopy(out, in, len, inform, mask, 0, 0); Executed by:
| 154154 | ||||||||||||||||||||||||
16 | } | - | ||||||||||||||||||||||||
17 | - | |||||||||||||||||||||||||
18 | int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len, | - | ||||||||||||||||||||||||
19 | int inform, unsigned long mask, | - | ||||||||||||||||||||||||
20 | long minsize, long maxsize) | - | ||||||||||||||||||||||||
21 | { | - | ||||||||||||||||||||||||
22 | int str_type; | - | ||||||||||||||||||||||||
23 | int ret; | - | ||||||||||||||||||||||||
24 | char free_out; | - | ||||||||||||||||||||||||
25 | int outform, outlen = 0; | - | ||||||||||||||||||||||||
26 | ASN1_STRING *dest; | - | ||||||||||||||||||||||||
27 | unsigned char *p; | - | ||||||||||||||||||||||||
28 | int nchar; | - | ||||||||||||||||||||||||
29 | char strbuf[32]; | - | ||||||||||||||||||||||||
30 | int (*cpyfunc) (unsigned long, void *) = | - | ||||||||||||||||||||||||
31 | ((void *)0) | - | ||||||||||||||||||||||||
32 | ; | - | ||||||||||||||||||||||||
33 | if (len == -1
| 765-154154 | ||||||||||||||||||||||||
34 | len = strlen((const char *)in); executed 765 times by 1 test: len = strlen((const char *)in); Executed by:
| 765 | ||||||||||||||||||||||||
35 | if (!mask
| 0-154919 | ||||||||||||||||||||||||
36 | mask = (0x0002|0x0004|0x0800|0x2000); never executed: mask = (0x0002|0x0004|0x0800|0x2000); | 0 | ||||||||||||||||||||||||
37 | - | |||||||||||||||||||||||||
38 | - | |||||||||||||||||||||||||
39 | switch (inform) { | - | ||||||||||||||||||||||||
40 | - | |||||||||||||||||||||||||
41 | case executed 7094 times by 1 test: (0x1000|2):case (0x1000|2): Executed by:
executed 7094 times by 1 test: case (0x1000|2): Executed by:
| 7094 | ||||||||||||||||||||||||
42 | if (len & 1
| 0-7094 | ||||||||||||||||||||||||
43 | ERR_put_error(13,(122),(129),__FILE__,65) | - | ||||||||||||||||||||||||
44 | ; | - | ||||||||||||||||||||||||
45 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||
46 | } | - | ||||||||||||||||||||||||
47 | nchar = len >> 1; | - | ||||||||||||||||||||||||
48 | break; executed 7094 times by 1 test: break; Executed by:
| 7094 | ||||||||||||||||||||||||
49 | - | |||||||||||||||||||||||||
50 | case executed 7520 times by 1 test: (0x1000|4):case (0x1000|4): Executed by:
executed 7520 times by 1 test: case (0x1000|4): Executed by:
| 7520 | ||||||||||||||||||||||||
51 | if (len & 3
| 0-7520 | ||||||||||||||||||||||||
52 | ERR_put_error(13,(122),(133),__FILE__,74) | - | ||||||||||||||||||||||||
53 | ; | - | ||||||||||||||||||||||||
54 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||
55 | } | - | ||||||||||||||||||||||||
56 | nchar = len >> 2; | - | ||||||||||||||||||||||||
57 | break; executed 7520 times by 1 test: break; Executed by:
| 7520 | ||||||||||||||||||||||||
58 | - | |||||||||||||||||||||||||
59 | case executed 85293 times by 1 test: (0x1000):case (0x1000): Executed by:
executed 85293 times by 1 test: case (0x1000): Executed by:
| 85293 | ||||||||||||||||||||||||
60 | nchar = 0; | - | ||||||||||||||||||||||||
61 | - | |||||||||||||||||||||||||
62 | ret = traverse_string(in, len, (0x1000), in_utf8, &nchar); | - | ||||||||||||||||||||||||
63 | if (ret < 0
| 4656-80637 | ||||||||||||||||||||||||
64 | ERR_put_error(13,(122),(134),__FILE__,85); | - | ||||||||||||||||||||||||
65 | return executed 4656 times by 1 test: -1;return -1; Executed by:
executed 4656 times by 1 test: return -1; Executed by:
| 4656 | ||||||||||||||||||||||||
66 | } | - | ||||||||||||||||||||||||
67 | break; executed 80637 times by 1 test: break; Executed by:
| 80637 | ||||||||||||||||||||||||
68 | - | |||||||||||||||||||||||||
69 | case executed 55012 times by 1 test: (0x1000|1):case (0x1000|1): Executed by:
executed 55012 times by 1 test: case (0x1000|1): Executed by:
| 55012 | ||||||||||||||||||||||||
70 | nchar = len; | - | ||||||||||||||||||||||||
71 | break; executed 55012 times by 1 test: break; Executed by:
| 55012 | ||||||||||||||||||||||||
72 | - | |||||||||||||||||||||||||
73 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||
74 | ERR_put_error(13,(122),(160),__FILE__,95); | - | ||||||||||||||||||||||||
75 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||
76 | } | - | ||||||||||||||||||||||||
77 | - | |||||||||||||||||||||||||
78 | if ((
| 0-149498 | ||||||||||||||||||||||||
79 | ERR_put_error(13,(122),(152),__FILE__,100); | - | ||||||||||||||||||||||||
80 | BIO_snprintf(strbuf, sizeof(strbuf), "%ld", minsize); | - | ||||||||||||||||||||||||
81 | ERR_add_error_data(2, "minsize=", strbuf); | - | ||||||||||||||||||||||||
82 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||
83 | } | - | ||||||||||||||||||||||||
84 | - | |||||||||||||||||||||||||
85 | if ((
| 0-149498 | ||||||||||||||||||||||||
86 | ERR_put_error(13,(122),(151),__FILE__,107); | - | ||||||||||||||||||||||||
87 | BIO_snprintf(strbuf, sizeof(strbuf), "%ld", maxsize); | - | ||||||||||||||||||||||||
88 | ERR_add_error_data(2, "maxsize=", strbuf); | - | ||||||||||||||||||||||||
89 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||
90 | } | - | ||||||||||||||||||||||||
91 | - | |||||||||||||||||||||||||
92 | - | |||||||||||||||||||||||||
93 | if (traverse_string(in, len, inform, type_str, &mask) < 0
| 0-150263 | ||||||||||||||||||||||||
94 | ERR_put_error(13,(122),(124),__FILE__,115); | - | ||||||||||||||||||||||||
95 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||
96 | } | - | ||||||||||||||||||||||||
97 | - | |||||||||||||||||||||||||
98 | - | |||||||||||||||||||||||||
99 | outform = (0x1000|1); | - | ||||||||||||||||||||||||
100 | if (mask & 0x0001
| 0-150263 | ||||||||||||||||||||||||
101 | str_type = 18; never executed: str_type = 18; | 0 | ||||||||||||||||||||||||
102 | else if (mask & 0x0002
| 11-150252 | ||||||||||||||||||||||||
103 | str_type = 19; executed 11 times by 1 test: str_type = 19; Executed by:
| 11 | ||||||||||||||||||||||||
104 | else if (mask & 0x0010
| 359-149893 | ||||||||||||||||||||||||
105 | str_type = 22; executed 359 times by 1 test: str_type = 22; Executed by:
| 359 | ||||||||||||||||||||||||
106 | else if (mask & 0x0004
| 0-149893 | ||||||||||||||||||||||||
107 | str_type = 20; never executed: str_type = 20; | 0 | ||||||||||||||||||||||||
108 | else if (mask & 0x0800
| 0-149893 | ||||||||||||||||||||||||
109 | str_type = 30; | - | ||||||||||||||||||||||||
110 | outform = (0x1000|2); | - | ||||||||||||||||||||||||
111 | } never executed: else if (mask & 0x0100end of block
| 0-149893 | ||||||||||||||||||||||||
112 | str_type = 28; | - | ||||||||||||||||||||||||
113 | outform = (0x1000|4); | - | ||||||||||||||||||||||||
114 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
115 | str_type = 12; | - | ||||||||||||||||||||||||
116 | outform = (0x1000); | - | ||||||||||||||||||||||||
117 | } executed 149893 times by 1 test: end of block Executed by:
| 149893 | ||||||||||||||||||||||||
118 | if (!out
| 0-150263 | ||||||||||||||||||||||||
119 | return never executed: str_type;return str_type; never executed: return str_type; | 0 | ||||||||||||||||||||||||
120 | if (*
| 0-150263 | ||||||||||||||||||||||||
121 | free_out = 0; | - | ||||||||||||||||||||||||
122 | dest = *out; | - | ||||||||||||||||||||||||
123 | CRYPTO_free(dest->data, __FILE__, 144); | - | ||||||||||||||||||||||||
124 | dest->data = | - | ||||||||||||||||||||||||
125 | ((void *)0) | - | ||||||||||||||||||||||||
126 | ; | - | ||||||||||||||||||||||||
127 | dest->length = 0; | - | ||||||||||||||||||||||||
128 | dest->type = str_type; | - | ||||||||||||||||||||||||
129 | } executed 150263 times by 1 test: else {end of block Executed by:
| 150263 | ||||||||||||||||||||||||
130 | free_out = 1; | - | ||||||||||||||||||||||||
131 | dest = ASN1_STRING_type_new(str_type); | - | ||||||||||||||||||||||||
132 | if (dest ==
| 0 | ||||||||||||||||||||||||
133 | ((void *)0)
| 0 | ||||||||||||||||||||||||
134 | ) { | - | ||||||||||||||||||||||||
135 | ERR_put_error(13,(122),((1|64)),__FILE__,152); | - | ||||||||||||||||||||||||
136 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||
137 | } | - | ||||||||||||||||||||||||
138 | *out = dest; | - | ||||||||||||||||||||||||
139 | } never executed: end of block | 0 | ||||||||||||||||||||||||
140 | - | |||||||||||||||||||||||||
141 | if (inform == outform
| 69256-81007 | ||||||||||||||||||||||||
142 | if (!ASN1_STRING_set(dest, in, len)
| 0-81007 | ||||||||||||||||||||||||
143 | ERR_put_error(13,(122),((1|64)),__FILE__,160); | - | ||||||||||||||||||||||||
144 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||
145 | } | - | ||||||||||||||||||||||||
146 | return executed 81007 times by 1 test: str_type;return str_type; Executed by:
executed 81007 times by 1 test: return str_type; Executed by:
| 81007 | ||||||||||||||||||||||||
147 | } | - | ||||||||||||||||||||||||
148 | - | |||||||||||||||||||||||||
149 | - | |||||||||||||||||||||||||
150 | switch (outform) { | - | ||||||||||||||||||||||||
151 | case never executed: (0x1000|1):case (0x1000|1): never executed: case (0x1000|1): | 0 | ||||||||||||||||||||||||
152 | outlen = nchar; | - | ||||||||||||||||||||||||
153 | cpyfunc = cpy_asc; | - | ||||||||||||||||||||||||
154 | break; never executed: break; | 0 | ||||||||||||||||||||||||
155 | - | |||||||||||||||||||||||||
156 | case never executed: (0x1000|2):case (0x1000|2): never executed: case (0x1000|2): | 0 | ||||||||||||||||||||||||
157 | outlen = nchar << 1; | - | ||||||||||||||||||||||||
158 | cpyfunc = cpy_bmp; | - | ||||||||||||||||||||||||
159 | break; never executed: break; | 0 | ||||||||||||||||||||||||
160 | - | |||||||||||||||||||||||||
161 | case never executed: (0x1000|4):case (0x1000|4): never executed: case (0x1000|4): | 0 | ||||||||||||||||||||||||
162 | outlen = nchar << 2; | - | ||||||||||||||||||||||||
163 | cpyfunc = cpy_univ; | - | ||||||||||||||||||||||||
164 | break; never executed: break; | 0 | ||||||||||||||||||||||||
165 | - | |||||||||||||||||||||||||
166 | case executed 69256 times by 1 test: (0x1000):case (0x1000): Executed by:
executed 69256 times by 1 test: case (0x1000): Executed by:
| 69256 | ||||||||||||||||||||||||
167 | outlen = 0; | - | ||||||||||||||||||||||||
168 | traverse_string(in, len, inform, out_utf8, &outlen); | - | ||||||||||||||||||||||||
169 | cpyfunc = cpy_utf8; | - | ||||||||||||||||||||||||
170 | break; executed 69256 times by 1 test: break; Executed by:
| 69256 | ||||||||||||||||||||||||
171 | } | - | ||||||||||||||||||||||||
172 | if ((
| 0-69256 | ||||||||||||||||||||||||
173 | ((void *)0)
| 0-69256 | ||||||||||||||||||||||||
174 | ) { | - | ||||||||||||||||||||||||
175 | if (free_out
| 0 | ||||||||||||||||||||||||
176 | ASN1_STRING_free(dest); never executed: ASN1_STRING_free(dest); | 0 | ||||||||||||||||||||||||
177 | ERR_put_error(13,(122),((1|64)),__FILE__,192); | - | ||||||||||||||||||||||||
178 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||
179 | } | - | ||||||||||||||||||||||||
180 | dest->length = outlen; | - | ||||||||||||||||||||||||
181 | dest->data = p; | - | ||||||||||||||||||||||||
182 | p[outlen] = 0; | - | ||||||||||||||||||||||||
183 | traverse_string(in, len, inform, cpyfunc, &p); | - | ||||||||||||||||||||||||
184 | return executed 69256 times by 1 test: str_type;return str_type; Executed by:
executed 69256 times by 1 test: return str_type; Executed by:
| 69256 | ||||||||||||||||||||||||
185 | } | - | ||||||||||||||||||||||||
186 | - | |||||||||||||||||||||||||
187 | - | |||||||||||||||||||||||||
188 | - | |||||||||||||||||||||||||
189 | - | |||||||||||||||||||||||||
190 | - | |||||||||||||||||||||||||
191 | - | |||||||||||||||||||||||||
192 | static int traverse_string(const unsigned char *p, int len, int inform, | - | ||||||||||||||||||||||||
193 | int (*rfunc) (unsigned long value, void *in), | - | ||||||||||||||||||||||||
194 | void *arg) | - | ||||||||||||||||||||||||
195 | { | - | ||||||||||||||||||||||||
196 | unsigned long value; | - | ||||||||||||||||||||||||
197 | int ret; | - | ||||||||||||||||||||||||
198 | while (len
| 369412-3369336 | ||||||||||||||||||||||||
199 | if (inform == (0x1000|1)
| 1638770-1730566 | ||||||||||||||||||||||||
200 | value = *p++; | - | ||||||||||||||||||||||||
201 | len--; | - | ||||||||||||||||||||||||
202 | } executed 1638770 times by 1 test: else if (inform == (0x1000|2)end of block Executed by:
| 54267-1676299 | ||||||||||||||||||||||||
203 | value = *p++ << 8; | - | ||||||||||||||||||||||||
204 | value |= *p++; | - | ||||||||||||||||||||||||
205 | len -= 2; | - | ||||||||||||||||||||||||
206 | } executed 54267 times by 1 test: else if (inform == (0x1000|4)end of block Executed by:
| 22413-1653886 | ||||||||||||||||||||||||
207 | value = ((unsigned long)*p++) << 24; | - | ||||||||||||||||||||||||
208 | value |= ((unsigned long)*p++) << 16; | - | ||||||||||||||||||||||||
209 | value |= *p++ << 8; | - | ||||||||||||||||||||||||
210 | value |= *p++; | - | ||||||||||||||||||||||||
211 | len -= 4; | - | ||||||||||||||||||||||||
212 | } executed 22413 times by 1 test: else {end of block Executed by:
| 22413 | ||||||||||||||||||||||||
213 | ret = UTF8_getc(p, len, &value); | - | ||||||||||||||||||||||||
214 | if (ret < 0
| 4656-1649230 | ||||||||||||||||||||||||
215 | return executed 4656 times by 1 test: -1;return -1; Executed by:
executed 4656 times by 1 test: return -1; Executed by:
| 4656 | ||||||||||||||||||||||||
216 | len -= ret; | - | ||||||||||||||||||||||||
217 | p += ret; | - | ||||||||||||||||||||||||
218 | } executed 1649230 times by 1 test: end of block Executed by:
| 1649230 | ||||||||||||||||||||||||
219 | if (rfunc
| 0-3364680 | ||||||||||||||||||||||||
220 | ret = rfunc(value, arg); | - | ||||||||||||||||||||||||
221 | if (ret <= 0
| 0-3364680 | ||||||||||||||||||||||||
222 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||||||||||||||
223 | } executed 3364680 times by 1 test: end of block Executed by:
| 3364680 | ||||||||||||||||||||||||
224 | } executed 3364680 times by 1 test: end of block Executed by:
| 3364680 | ||||||||||||||||||||||||
225 | return executed 369412 times by 1 test: 1;return 1; Executed by:
executed 369412 times by 1 test: return 1; Executed by:
| 369412 | ||||||||||||||||||||||||
226 | } | - | ||||||||||||||||||||||||
227 | - | |||||||||||||||||||||||||
228 | - | |||||||||||||||||||||||||
229 | - | |||||||||||||||||||||||||
230 | - | |||||||||||||||||||||||||
231 | - | |||||||||||||||||||||||||
232 | static int in_utf8(unsigned long value, void *arg) | - | ||||||||||||||||||||||||
233 | { | - | ||||||||||||||||||||||||
234 | int *nchar; | - | ||||||||||||||||||||||||
235 | nchar = arg; | - | ||||||||||||||||||||||||
236 | (*nchar)++; | - | ||||||||||||||||||||||||
237 | return executed 833749 times by 1 test: 1;return 1; Executed by:
executed 833749 times by 1 test: return 1; Executed by:
| 833749 | ||||||||||||||||||||||||
238 | } | - | ||||||||||||||||||||||||
239 | - | |||||||||||||||||||||||||
240 | - | |||||||||||||||||||||||||
241 | - | |||||||||||||||||||||||||
242 | static int out_utf8(unsigned long value, void *arg) | - | ||||||||||||||||||||||||
243 | { | - | ||||||||||||||||||||||||
244 | int *outlen; | - | ||||||||||||||||||||||||
245 | outlen = arg; | - | ||||||||||||||||||||||||
246 | *outlen += UTF8_putc( | - | ||||||||||||||||||||||||
247 | ((void *)0) | - | ||||||||||||||||||||||||
248 | , -1, value); | - | ||||||||||||||||||||||||
249 | return executed 570249 times by 1 test: 1;return 1; Executed by:
executed 570249 times by 1 test: return 1; Executed by:
| 570249 | ||||||||||||||||||||||||
250 | } | - | ||||||||||||||||||||||||
251 | - | |||||||||||||||||||||||||
252 | - | |||||||||||||||||||||||||
253 | - | |||||||||||||||||||||||||
254 | - | |||||||||||||||||||||||||
255 | - | |||||||||||||||||||||||||
256 | - | |||||||||||||||||||||||||
257 | static int type_str(unsigned long value, void *arg) | - | ||||||||||||||||||||||||
258 | { | - | ||||||||||||||||||||||||
259 | unsigned long types = *((unsigned long *)arg); | - | ||||||||||||||||||||||||
260 | const int native = value > 0x7fffffff
| 1460-1388973 | ||||||||||||||||||||||||
261 | - | |||||||||||||||||||||||||
262 | if ((
| 0-1390433 | ||||||||||||||||||||||||
263 | || native == ' '
| 0 | ||||||||||||||||||||||||
264 | types &= ~0x0001; never executed: types &= ~0x0001; | 0 | ||||||||||||||||||||||||
265 | if ((
| 0-1390411 | ||||||||||||||||||||||||
266 | types &= ~0x0002; never executed: types &= ~0x0002; | 0 | ||||||||||||||||||||||||
267 | if ((
| 0-1385752 | ||||||||||||||||||||||||
268 | types &= ~0x0010; never executed: types &= ~0x0010; | 0 | ||||||||||||||||||||||||
269 | if ((
| 0-1390433 | ||||||||||||||||||||||||
270 | types &= ~0x0004; never executed: types &= ~0x0004; | 0 | ||||||||||||||||||||||||
271 | if ((
| 0-1390433 | ||||||||||||||||||||||||
272 | types &= ~0x0800; never executed: types &= ~0x0800; | 0 | ||||||||||||||||||||||||
273 | if (!types
| 0-1390433 | ||||||||||||||||||||||||
274 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||
275 | *((unsigned long *)arg) = types; | - | ||||||||||||||||||||||||
276 | return executed 1390433 times by 1 test: 1;return 1; Executed by:
executed 1390433 times by 1 test: return 1; Executed by:
| 1390433 | ||||||||||||||||||||||||
277 | } | - | ||||||||||||||||||||||||
278 | - | |||||||||||||||||||||||||
279 | - | |||||||||||||||||||||||||
280 | - | |||||||||||||||||||||||||
281 | static int cpy_asc(unsigned long value, void *arg) | - | ||||||||||||||||||||||||
282 | { | - | ||||||||||||||||||||||||
283 | unsigned char **p, *q; | - | ||||||||||||||||||||||||
284 | p = arg; | - | ||||||||||||||||||||||||
285 | q = *p; | - | ||||||||||||||||||||||||
286 | *q = (unsigned char)value; | - | ||||||||||||||||||||||||
287 | (*p)++; | - | ||||||||||||||||||||||||
288 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||
289 | } | - | ||||||||||||||||||||||||
290 | - | |||||||||||||||||||||||||
291 | - | |||||||||||||||||||||||||
292 | - | |||||||||||||||||||||||||
293 | static int cpy_bmp(unsigned long value, void *arg) | - | ||||||||||||||||||||||||
294 | { | - | ||||||||||||||||||||||||
295 | unsigned char **p, *q; | - | ||||||||||||||||||||||||
296 | p = arg; | - | ||||||||||||||||||||||||
297 | q = *p; | - | ||||||||||||||||||||||||
298 | *q++ = (unsigned char)((value >> 8) & 0xff); | - | ||||||||||||||||||||||||
299 | *q = (unsigned char)(value & 0xff); | - | ||||||||||||||||||||||||
300 | *p += 2; | - | ||||||||||||||||||||||||
301 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||
302 | } | - | ||||||||||||||||||||||||
303 | - | |||||||||||||||||||||||||
304 | - | |||||||||||||||||||||||||
305 | - | |||||||||||||||||||||||||
306 | static int cpy_univ(unsigned long value, void *arg) | - | ||||||||||||||||||||||||
307 | { | - | ||||||||||||||||||||||||
308 | unsigned char **p, *q; | - | ||||||||||||||||||||||||
309 | p = arg; | - | ||||||||||||||||||||||||
310 | q = *p; | - | ||||||||||||||||||||||||
311 | *q++ = (unsigned char)((value >> 24) & 0xff); | - | ||||||||||||||||||||||||
312 | *q++ = (unsigned char)((value >> 16) & 0xff); | - | ||||||||||||||||||||||||
313 | *q++ = (unsigned char)((value >> 8) & 0xff); | - | ||||||||||||||||||||||||
314 | *q = (unsigned char)(value & 0xff); | - | ||||||||||||||||||||||||
315 | *p += 4; | - | ||||||||||||||||||||||||
316 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||
317 | } | - | ||||||||||||||||||||||||
318 | - | |||||||||||||||||||||||||
319 | - | |||||||||||||||||||||||||
320 | - | |||||||||||||||||||||||||
321 | static int cpy_utf8(unsigned long value, void *arg) | - | ||||||||||||||||||||||||
322 | { | - | ||||||||||||||||||||||||
323 | unsigned char **p; | - | ||||||||||||||||||||||||
324 | int ret; | - | ||||||||||||||||||||||||
325 | p = arg; | - | ||||||||||||||||||||||||
326 | - | |||||||||||||||||||||||||
327 | ret = UTF8_putc(*p, 0xff, value); | - | ||||||||||||||||||||||||
328 | *p += ret; | - | ||||||||||||||||||||||||
329 | return executed 570249 times by 1 test: 1;return 1; Executed by:
executed 570249 times by 1 test: return 1; Executed by:
| 570249 | ||||||||||||||||||||||||
330 | } | - | ||||||||||||||||||||||||
Switch to Source code | Preprocessed file |