Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | int | - |
7 | pcre16_utf16_to_host_byte_order(unsigned short *output, const unsigned short * input, | - |
8 | int length, int *host_byte_order, int keep_boms) | - |
9 | { | - |
10 | | - |
11 | | - |
12 | | - |
13 | int host_bo = host_byte_order != ((void *)0) ? *host_byte_order : 1; never evaluated: host_byte_order != ((void *)0) | 0 |
14 | pcre_uchar *optr = (pcre_uchar *)output; | - |
15 | const pcre_uchar *iptr = (const pcre_uchar *)input; | - |
16 | const pcre_uchar *end; | - |
17 | | - |
18 | register pcre_uchar c; | - |
19 | | - |
20 | if (length < 0) never evaluated: length < 0 | 0 |
21 | length = _pcre16_strlen_uc(iptr) + 1; never executed: length = _pcre16_strlen_uc(iptr) + 1; | 0 |
22 | end = iptr + length; | - |
23 | | - |
24 | while (iptr < end) never evaluated: iptr < end | 0 |
25 | { | - |
26 | c = *iptr++; | - |
27 | if (c == 0xfeff || c == 0xfffe) never evaluated: c == 0xfeff never evaluated: c == 0xfffe | 0 |
28 | { | - |
29 | | - |
30 | | - |
31 | host_bo = c == 0xfeff; | - |
32 | if (keep_boms != 0) never evaluated: keep_boms != 0 | 0 |
33 | *optr++ = 0xfeff; never executed: *optr++ = 0xfeff; | 0 |
34 | else | - |
35 | length--; never executed: length--; | 0 |
36 | } | - |
37 | else | - |
38 | *optr++ = host_bo ? c : ((c >> 8) | (c << 8)); never executed: *optr++ = host_bo ? c : ((c >> 8) | (c << 8)); | 0 |
39 | } | - |
40 | if (host_byte_order != ((void *)0)) never evaluated: host_byte_order != ((void *)0) | 0 |
41 | *host_byte_order = host_bo; never executed: *host_byte_order = host_bo; | 0 |
42 | | - |
43 | | - |
44 | | - |
45 | | - |
46 | | - |
47 | | - |
48 | return length; never executed: return length; | 0 |
49 | } | - |
50 | | - |
| | |