| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/bio/b_print.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | static int fmtstr(char **, char **, size_t *, size_t *, | - | ||||||||||||||||||||||||
| 2 | const char *, int, int, int); | - | ||||||||||||||||||||||||
| 3 | static int fmtint(char **, char **, size_t *, size_t *, | - | ||||||||||||||||||||||||
| 4 | int64_t, int, int, int, int); | - | ||||||||||||||||||||||||
| 5 | static int fmtfp(char **, char **, size_t *, size_t *, | - | ||||||||||||||||||||||||
| 6 | double, int, int, int, int); | - | ||||||||||||||||||||||||
| 7 | static int doapr_outch(char **, char **, size_t *, size_t *, int); | - | ||||||||||||||||||||||||
| 8 | static int _dopr(char **sbuffer, char **buffer, | - | ||||||||||||||||||||||||
| 9 | size_t *maxlen, size_t *retlen, int *truncated, | - | ||||||||||||||||||||||||
| 10 | const char *format, va_list args); | - | ||||||||||||||||||||||||
| 11 | static int | - | ||||||||||||||||||||||||
| 12 | _dopr(char **sbuffer, | - | ||||||||||||||||||||||||
| 13 | char **buffer, | - | ||||||||||||||||||||||||
| 14 | size_t *maxlen, | - | ||||||||||||||||||||||||
| 15 | size_t *retlen, int *truncated, const char *format, va_list args) | - | ||||||||||||||||||||||||
| 16 | { | - | ||||||||||||||||||||||||
| 17 | char ch; | - | ||||||||||||||||||||||||
| 18 | int64_t value; | - | ||||||||||||||||||||||||
| 19 | double fvalue; | - | ||||||||||||||||||||||||
| 20 | char *strvalue; | - | ||||||||||||||||||||||||
| 21 | int min; | - | ||||||||||||||||||||||||
| 22 | int max; | - | ||||||||||||||||||||||||
| 23 | int state; | - | ||||||||||||||||||||||||
| 24 | int flags; | - | ||||||||||||||||||||||||
| 25 | int cflags; | - | ||||||||||||||||||||||||
| 26 | size_t currlen; | - | ||||||||||||||||||||||||
| 27 | - | |||||||||||||||||||||||||
| 28 | state = 0; | - | ||||||||||||||||||||||||
| 29 | flags = currlen = cflags = min = 0; | - | ||||||||||||||||||||||||
| 30 | max = -1; | - | ||||||||||||||||||||||||
| 31 | ch = *format++; | - | ||||||||||||||||||||||||
| 32 | - | |||||||||||||||||||||||||
| 33 | while (state != 7
| 8876302-119848483 | ||||||||||||||||||||||||
| 34 | if (ch == '\0'
| 7070172-110972181 | ||||||||||||||||||||||||
| 35 | ((void *)0)
| 7070172-103902009 | ||||||||||||||||||||||||
| 36 | && currlen >= *maxlen
| 0-7070172 | ||||||||||||||||||||||||
| 37 | state = 7; executed 8876302 times by 12 tests: state = 7;Executed by:
| 8876302 | ||||||||||||||||||||||||
| 38 | - | |||||||||||||||||||||||||
| 39 | switch (state) { | - | ||||||||||||||||||||||||
| 40 | case executed 33570494 times by 12 tests: 0:case 0:Executed by:
executed 33570494 times by 12 tests: case 0:Executed by:
| 33570494 | ||||||||||||||||||||||||
| 41 | if (ch == '%'
| 12102492-21468002 | ||||||||||||||||||||||||
| 42 | state = 1; executed 12102492 times by 12 tests: state = 1;Executed by:
| 12102492 | ||||||||||||||||||||||||
| 43 | else | - | ||||||||||||||||||||||||
| 44 | if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch)
| 0-21468002 | ||||||||||||||||||||||||
| 45 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 46 | ch = *format++; | - | ||||||||||||||||||||||||
| 47 | break; executed 33570494 times by 12 tests: break;Executed by:
| 33570494 | ||||||||||||||||||||||||
| 48 | case executed 18525771 times by 12 tests: 1:case 1:Executed by:
executed 18525771 times by 12 tests: case 1:Executed by:
| 18525771 | ||||||||||||||||||||||||
| 49 | switch (ch) { | - | ||||||||||||||||||||||||
| 50 | case executed 2857542 times by 1 test: '-':case '-':Executed by:
executed 2857542 times by 1 test: case '-':Executed by:
| 2857542 | ||||||||||||||||||||||||
| 51 | flags |= (1 << 0); | - | ||||||||||||||||||||||||
| 52 | ch = *format++; | - | ||||||||||||||||||||||||
| 53 | break; executed 2857542 times by 1 test: break;Executed by:
| 2857542 | ||||||||||||||||||||||||
| 54 | case never executed: '+':case '+':never executed: case '+': | 0 | ||||||||||||||||||||||||
| 55 | flags |= (1 << 1); | - | ||||||||||||||||||||||||
| 56 | ch = *format++; | - | ||||||||||||||||||||||||
| 57 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 58 | case executed 216 times by 1 test: ' ':case ' ':Executed by:
executed 216 times by 1 test: case ' ':Executed by:
| 216 | ||||||||||||||||||||||||
| 59 | flags |= (1 << 2); | - | ||||||||||||||||||||||||
| 60 | ch = *format++; | - | ||||||||||||||||||||||||
| 61 | break; executed 216 times by 1 test: break;Executed by:
| 216 | ||||||||||||||||||||||||
| 62 | case never executed: '#':case '#':never executed: case '#': | 0 | ||||||||||||||||||||||||
| 63 | flags |= (1 << 3); | - | ||||||||||||||||||||||||
| 64 | ch = *format++; | - | ||||||||||||||||||||||||
| 65 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 66 | case executed 3565521 times by 1 test: '0':case '0':Executed by:
executed 3565521 times by 1 test: case '0':Executed by:
| 3565521 | ||||||||||||||||||||||||
| 67 | flags |= (1 << 4); | - | ||||||||||||||||||||||||
| 68 | ch = *format++; | - | ||||||||||||||||||||||||
| 69 | break; executed 3565521 times by 1 test: break;Executed by:
| 3565521 | ||||||||||||||||||||||||
| 70 | default executed 12102492 times by 12 tests: :default:Executed by:
executed 12102492 times by 12 tests: default:Executed by:
| 12102492 | ||||||||||||||||||||||||
| 71 | state = 2; | - | ||||||||||||||||||||||||
| 72 | break; executed 12102492 times by 12 tests: break;Executed by:
| 12102492 | ||||||||||||||||||||||||
| 73 | } | - | ||||||||||||||||||||||||
| 74 | break; executed 18525771 times by 12 tests: break;Executed by:
| 18525771 | ||||||||||||||||||||||||
| 75 | case executed 22556335 times by 12 tests: 2:case 2:Executed by:
executed 22556335 times by 12 tests: case 2:Executed by:
| 22556335 | ||||||||||||||||||||||||
| 76 | if ((
| 10453843-12102492 | ||||||||||||||||||||||||
| 77 | min = 10 * min + (ch - '0'); | - | ||||||||||||||||||||||||
| 78 | ch = *format++; | - | ||||||||||||||||||||||||
| 79 | } executed 10453843 times by 1 test: else if (ch == '*'end of blockExecuted by:
| 304477-11798015 | ||||||||||||||||||||||||
| 80 | min = | - | ||||||||||||||||||||||||
| 81 | __builtin_va_arg( | - | ||||||||||||||||||||||||
| 82 | args | - | ||||||||||||||||||||||||
| 83 | , | - | ||||||||||||||||||||||||
| 84 | int | - | ||||||||||||||||||||||||
| 85 | ) | - | ||||||||||||||||||||||||
| 86 | ; | - | ||||||||||||||||||||||||
| 87 | ch = *format++; | - | ||||||||||||||||||||||||
| 88 | state = 3; | - | ||||||||||||||||||||||||
| 89 | } executed 304477 times by 12 tests: elseend of blockExecuted by:
| 304477 | ||||||||||||||||||||||||
| 90 | state = 3; executed 11798015 times by 12 tests: state = 3;Executed by:
| 11798015 | ||||||||||||||||||||||||
| 91 | break; executed 22556335 times by 12 tests: break;Executed by:
| 22556335 | ||||||||||||||||||||||||
| 92 | case executed 12102492 times by 12 tests: 3:case 3:Executed by:
executed 12102492 times by 12 tests: case 3:Executed by:
| 12102492 | ||||||||||||||||||||||||
| 93 | if (ch == '.'
| 7123-12095369 | ||||||||||||||||||||||||
| 94 | state = 4; | - | ||||||||||||||||||||||||
| 95 | ch = *format++; | - | ||||||||||||||||||||||||
| 96 | } executed 7123 times by 1 test: elseend of blockExecuted by:
| 7123 | ||||||||||||||||||||||||
| 97 | state = 5; executed 12095369 times by 12 tests: state = 5;Executed by:
| 12095369 | ||||||||||||||||||||||||
| 98 | break; executed 12102492 times by 12 tests: break;Executed by:
| 12102492 | ||||||||||||||||||||||||
| 99 | case executed 12105 times by 1 test: 4:case 4:Executed by:
executed 12105 times by 1 test: case 4:Executed by:
| 12105 | ||||||||||||||||||||||||
| 100 | if ((
| 4982-7123 | ||||||||||||||||||||||||
| 101 | if (max < 0
| 2338-2644 | ||||||||||||||||||||||||
| 102 | max = 0; executed 2644 times by 1 test: max = 0;Executed by:
| 2644 | ||||||||||||||||||||||||
| 103 | max = 10 * max + (ch - '0'); | - | ||||||||||||||||||||||||
| 104 | ch = *format++; | - | ||||||||||||||||||||||||
| 105 | } executed 4982 times by 1 test: else if (ch == '*'end of blockExecuted by:
| 2644-4982 | ||||||||||||||||||||||||
| 106 | max = | - | ||||||||||||||||||||||||
| 107 | __builtin_va_arg( | - | ||||||||||||||||||||||||
| 108 | args | - | ||||||||||||||||||||||||
| 109 | , | - | ||||||||||||||||||||||||
| 110 | int | - | ||||||||||||||||||||||||
| 111 | ) | - | ||||||||||||||||||||||||
| 112 | ; | - | ||||||||||||||||||||||||
| 113 | ch = *format++; | - | ||||||||||||||||||||||||
| 114 | state = 5; | - | ||||||||||||||||||||||||
| 115 | } executed 4479 times by 1 test: elseend of blockExecuted by:
| 4479 | ||||||||||||||||||||||||
| 116 | state = 5; executed 2644 times by 1 test: state = 5;Executed by:
| 2644 | ||||||||||||||||||||||||
| 117 | break; executed 12105 times by 1 test: break;Executed by:
| 12105 | ||||||||||||||||||||||||
| 118 | case executed 12102492 times by 12 tests: 5:case 5:Executed by:
executed 12102492 times by 12 tests: case 5:Executed by:
| 12102492 | ||||||||||||||||||||||||
| 119 | switch (ch) { | - | ||||||||||||||||||||||||
| 120 | case never executed: 'h':case 'h':never executed: case 'h': | 0 | ||||||||||||||||||||||||
| 121 | cflags = 1; | - | ||||||||||||||||||||||||
| 122 | ch = *format++; | - | ||||||||||||||||||||||||
| 123 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 124 | case executed 4416542 times by 2 tests: 'l':case 'l':Executed by:
executed 4416542 times by 2 tests: case 'l':Executed by:
| 4416542 | ||||||||||||||||||||||||
| 125 | if (*
| 0-4416542 | ||||||||||||||||||||||||
| 126 | cflags = 4; | - | ||||||||||||||||||||||||
| 127 | format++; | - | ||||||||||||||||||||||||
| 128 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||
| 129 | cflags = 2; executed 4416542 times by 2 tests: cflags = 2;Executed by:
| 4416542 | ||||||||||||||||||||||||
| 130 | ch = *format++; | - | ||||||||||||||||||||||||
| 131 | break; executed 4416542 times by 2 tests: break;Executed by:
| 4416542 | ||||||||||||||||||||||||
| 132 | case never executed: 'q':case 'q':never executed: case 'q': | 0 | ||||||||||||||||||||||||
| 133 | case executed 432 times by 1 test: 'j':case 'j':Executed by:
executed 432 times by 1 test: case 'j':Executed by:
| 432 | ||||||||||||||||||||||||
| 134 | cflags = 4; | - | ||||||||||||||||||||||||
| 135 | ch = *format++; | - | ||||||||||||||||||||||||
| 136 | break; executed 432 times by 1 test: break;Executed by:
| 432 | ||||||||||||||||||||||||
| 137 | case never executed: 'L':case 'L':never executed: case 'L': | 0 | ||||||||||||||||||||||||
| 138 | cflags = 3; | - | ||||||||||||||||||||||||
| 139 | ch = *format++; | - | ||||||||||||||||||||||||
| 140 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 141 | case executed 17 times by 1 test: 'z':case 'z':Executed by:
executed 17 times by 1 test: case 'z':Executed by:
| 17 | ||||||||||||||||||||||||
| 142 | cflags = 5; | - | ||||||||||||||||||||||||
| 143 | ch = *format++; | - | ||||||||||||||||||||||||
| 144 | break; executed 17 times by 1 test: break;Executed by:
| 17 | ||||||||||||||||||||||||
| 145 | default executed 7685501 times by 12 tests: :default:Executed by:
executed 7685501 times by 12 tests: default:Executed by:
| 7685501 | ||||||||||||||||||||||||
| 146 | break; executed 7685501 times by 12 tests: break;Executed by:
| 7685501 | ||||||||||||||||||||||||
| 147 | } | - | ||||||||||||||||||||||||
| 148 | state = 6; | - | ||||||||||||||||||||||||
| 149 | break; executed 12102492 times by 12 tests: break;Executed by:
| 12102492 | ||||||||||||||||||||||||
| 150 | case executed 12102492 times by 12 tests: 6:case 6:Executed by:
executed 12102492 times by 12 tests: case 6:Executed by:
| 12102492 | ||||||||||||||||||||||||
| 151 | switch (ch) { | - | ||||||||||||||||||||||||
| 152 | case executed 5641261 times by 11 tests: 'd':case 'd':Executed by:
executed 5641261 times by 11 tests: case 'd':Executed by:
| 5641261 | ||||||||||||||||||||||||
| 153 | case executed 6 times by 1 test: 'i':case 'i':Executed by:
executed 6 times by 1 test: case 'i':Executed by:
| 6 | ||||||||||||||||||||||||
| 154 | switch (cflags) { | - | ||||||||||||||||||||||||
| 155 | case never executed: 1:case 1:never executed: case 1: | 0 | ||||||||||||||||||||||||
| 156 | value = (short int) | - | ||||||||||||||||||||||||
| 157 | __builtin_va_arg( | - | ||||||||||||||||||||||||
| 158 | args | - | ||||||||||||||||||||||||
| 159 | , | - | ||||||||||||||||||||||||
| 160 | int | - | ||||||||||||||||||||||||
| 161 | ) | - | ||||||||||||||||||||||||
| 162 | ; | - | ||||||||||||||||||||||||
| 163 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 164 | case executed 3987970 times by 1 test: 2:case 2:Executed by:
executed 3987970 times by 1 test: case 2:Executed by:
| 3987970 | ||||||||||||||||||||||||
| 165 | value = | - | ||||||||||||||||||||||||
| 166 | __builtin_va_arg( | - | ||||||||||||||||||||||||
| 167 | args | - | ||||||||||||||||||||||||
| 168 | , | - | ||||||||||||||||||||||||
| 169 | long int | - | ||||||||||||||||||||||||
| 170 | ) | - | ||||||||||||||||||||||||
| 171 | ; | - | ||||||||||||||||||||||||
| 172 | break; executed 3987970 times by 1 test: break;Executed by:
| 3987970 | ||||||||||||||||||||||||
| 173 | case executed 29 times by 1 test: 4:case 4:Executed by:
executed 29 times by 1 test: case 4:Executed by:
| 29 | ||||||||||||||||||||||||
| 174 | value = | - | ||||||||||||||||||||||||
| 175 | __builtin_va_arg( | - | ||||||||||||||||||||||||
| 176 | args | - | ||||||||||||||||||||||||
| 177 | , | - | ||||||||||||||||||||||||
| 178 | int64_t | - | ||||||||||||||||||||||||
| 179 | ) | - | ||||||||||||||||||||||||
| 180 | ; | - | ||||||||||||||||||||||||
| 181 | break; executed 29 times by 1 test: break;Executed by:
| 29 | ||||||||||||||||||||||||
| 182 | case executed 2 times by 1 test: 5:case 5:Executed by:
executed 2 times by 1 test: case 5:Executed by:
| 2 | ||||||||||||||||||||||||
| 183 | value = | - | ||||||||||||||||||||||||
| 184 | __builtin_va_arg( | - | ||||||||||||||||||||||||
| 185 | args | - | ||||||||||||||||||||||||
| 186 | , | - | ||||||||||||||||||||||||
| 187 | ssize_t | - | ||||||||||||||||||||||||
| 188 | ) | - | ||||||||||||||||||||||||
| 189 | ; | - | ||||||||||||||||||||||||
| 190 | break; executed 2 times by 1 test: break;Executed by:
| 2 | ||||||||||||||||||||||||
| 191 | default executed 1653266 times by 11 tests: :default:Executed by:
executed 1653266 times by 11 tests: default:Executed by:
| 1653266 | ||||||||||||||||||||||||
| 192 | value = | - | ||||||||||||||||||||||||
| 193 | __builtin_va_arg( | - | ||||||||||||||||||||||||
| 194 | args | - | ||||||||||||||||||||||||
| 195 | , | - | ||||||||||||||||||||||||
| 196 | int | - | ||||||||||||||||||||||||
| 197 | ) | - | ||||||||||||||||||||||||
| 198 | ; | - | ||||||||||||||||||||||||
| 199 | break; executed 1653266 times by 11 tests: break;Executed by:
| 1653266 | ||||||||||||||||||||||||
| 200 | } | - | ||||||||||||||||||||||||
| 201 | if (!fmtint(sbuffer, buffer, &currlen, maxlen, value, 10, min,
| 0-5641267 | ||||||||||||||||||||||||
| 202 | max, flags)
| 0-5641267 | ||||||||||||||||||||||||
| 203 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 204 | break; executed 5641267 times by 11 tests: break;Executed by:
| 5641267 | ||||||||||||||||||||||||
| 205 | case executed 3015980 times by 1 test: 'X':case 'X':Executed by:
executed 3015980 times by 1 test: case 'X':Executed by:
| 3015980 | ||||||||||||||||||||||||
| 206 | flags |= (1 << 5); | - | ||||||||||||||||||||||||
| 207 | - | |||||||||||||||||||||||||
| 208 | case executed 466992 times by 1 test: 'x':case 'x':Executed by:
executed 466992 times by 1 test: case 'x':Executed by:
code before this statement executed 3015980 times by 1 test: case 'x':Executed by:
| 466992-3015980 | ||||||||||||||||||||||||
| 209 | case never executed: 'o':case 'o':never executed: case 'o': | 0 | ||||||||||||||||||||||||
| 210 | case executed 421034 times by 2 tests: 'u':case 'u':Executed by:
executed 421034 times by 2 tests: case 'u':Executed by:
| 421034 | ||||||||||||||||||||||||
| 211 | flags |= (1 << 6); | - | ||||||||||||||||||||||||
| 212 | switch (cflags) { | - | ||||||||||||||||||||||||
| 213 | case never executed: 1:case 1:never executed: case 1: | 0 | ||||||||||||||||||||||||
| 214 | value = (unsigned short int) | - | ||||||||||||||||||||||||
| 215 | __builtin_va_arg( | - | ||||||||||||||||||||||||
| 216 | args | - | ||||||||||||||||||||||||
| 217 | , | - | ||||||||||||||||||||||||
| 218 | unsigned int | - | ||||||||||||||||||||||||
| 219 | ) | - | ||||||||||||||||||||||||
| 220 | ; | - | ||||||||||||||||||||||||
| 221 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 222 | case executed 428572 times by 2 tests: 2:case 2:Executed by:
executed 428572 times by 2 tests: case 2:Executed by:
| 428572 | ||||||||||||||||||||||||
| 223 | value = | - | ||||||||||||||||||||||||
| 224 | __builtin_va_arg( | - | ||||||||||||||||||||||||
| 225 | args | - | ||||||||||||||||||||||||
| 226 | , | - | ||||||||||||||||||||||||
| 227 | unsigned long int | - | ||||||||||||||||||||||||
| 228 | ) | - | ||||||||||||||||||||||||
| 229 | ; | - | ||||||||||||||||||||||||
| 230 | break; executed 428572 times by 2 tests: break;Executed by:
| 428572 | ||||||||||||||||||||||||
| 231 | case executed 403 times by 1 test: 4:case 4:Executed by:
executed 403 times by 1 test: case 4:Executed by:
| 403 | ||||||||||||||||||||||||
| 232 | value = | - | ||||||||||||||||||||||||
| 233 | __builtin_va_arg( | - | ||||||||||||||||||||||||
| 234 | args | - | ||||||||||||||||||||||||
| 235 | , | - | ||||||||||||||||||||||||
| 236 | uint64_t | - | ||||||||||||||||||||||||
| 237 | ) | - | ||||||||||||||||||||||||
| 238 | ; | - | ||||||||||||||||||||||||
| 239 | break; executed 403 times by 1 test: break;Executed by:
| 403 | ||||||||||||||||||||||||
| 240 | case executed 15 times by 1 test: 5:case 5:Executed by:
executed 15 times by 1 test: case 5:Executed by:
| 15 | ||||||||||||||||||||||||
| 241 | value = | - | ||||||||||||||||||||||||
| 242 | __builtin_va_arg( | - | ||||||||||||||||||||||||
| 243 | args | - | ||||||||||||||||||||||||
| 244 | , | - | ||||||||||||||||||||||||
| 245 | size_t | - | ||||||||||||||||||||||||
| 246 | ) | - | ||||||||||||||||||||||||
| 247 | ; | - | ||||||||||||||||||||||||
| 248 | break; executed 15 times by 1 test: break;Executed by:
| 15 | ||||||||||||||||||||||||
| 249 | default executed 3475016 times by 1 test: :default:Executed by:
executed 3475016 times by 1 test: default:Executed by:
| 3475016 | ||||||||||||||||||||||||
| 250 | value = | - | ||||||||||||||||||||||||
| 251 | __builtin_va_arg( | - | ||||||||||||||||||||||||
| 252 | args | - | ||||||||||||||||||||||||
| 253 | , | - | ||||||||||||||||||||||||
| 254 | unsigned int | - | ||||||||||||||||||||||||
| 255 | ) | - | ||||||||||||||||||||||||
| 256 | ; | - | ||||||||||||||||||||||||
| 257 | break; executed 3475016 times by 1 test: break;Executed by:
| 3475016 | ||||||||||||||||||||||||
| 258 | } | - | ||||||||||||||||||||||||
| 259 | if (!fmtint(sbuffer, buffer, &currlen, maxlen, value,
| 0-3904006 | ||||||||||||||||||||||||
| 260 | ch == 'o' ? 8 : (ch == 'u' ? 10 : 16),
| 0-3904006 | ||||||||||||||||||||||||
| 261 | min, max, flags)
| 0-3904006 | ||||||||||||||||||||||||
| 262 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 263 | break; executed 3904006 times by 2 tests: break;Executed by:
| 3904006 | ||||||||||||||||||||||||
| 264 | case executed 77 times by 1 test: 'f':case 'f':Executed by:
executed 77 times by 1 test: case 'f':Executed by:
| 77 | ||||||||||||||||||||||||
| 265 | if (cflags == 3
| 0-77 | ||||||||||||||||||||||||
| 266 | fvalue = never executed: fvalue = __builtin_va_arg( args , double ) ; | 0 | ||||||||||||||||||||||||
| 267 | __builtin_va_arg( never executed: fvalue = __builtin_va_arg( args , double ) ; | 0 | ||||||||||||||||||||||||
| 268 | args never executed: fvalue = __builtin_va_arg( args , double ) ; | 0 | ||||||||||||||||||||||||
| 269 | , never executed: fvalue = __builtin_va_arg( args , double ) ; | 0 | ||||||||||||||||||||||||
| 270 | double never executed: fvalue = __builtin_va_arg( args , double ) ; | 0 | ||||||||||||||||||||||||
| 271 | ) never executed: fvalue = __builtin_va_arg( args , double ) ; | 0 | ||||||||||||||||||||||||
| 272 | ; never executed: fvalue = __builtin_va_arg( args , double ) ; | 0 | ||||||||||||||||||||||||
| 273 | else | - | ||||||||||||||||||||||||
| 274 | fvalue = executed 77 times by 1 test: fvalue = __builtin_va_arg( args , double ) ;Executed by:
| 77 | ||||||||||||||||||||||||
| 275 | __builtin_va_arg( executed 77 times by 1 test: fvalue = __builtin_va_arg( args , double ) ;Executed by:
| 77 | ||||||||||||||||||||||||
| 276 | args executed 77 times by 1 test: fvalue = __builtin_va_arg( args , double ) ;Executed by:
| 77 | ||||||||||||||||||||||||
| 277 | , executed 77 times by 1 test: fvalue = __builtin_va_arg( args , double ) ;Executed by:
| 77 | ||||||||||||||||||||||||
| 278 | double executed 77 times by 1 test: fvalue = __builtin_va_arg( args , double ) ;Executed by:
| 77 | ||||||||||||||||||||||||
| 279 | ) executed 77 times by 1 test: fvalue = __builtin_va_arg( args , double ) ;Executed by:
| 77 | ||||||||||||||||||||||||
| 280 | ; executed 77 times by 1 test: fvalue = __builtin_va_arg( args , double ) ;Executed by:
| 77 | ||||||||||||||||||||||||
| 281 | if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max,
| 1-76 | ||||||||||||||||||||||||
| 282 | flags, 0)
| 1-76 | ||||||||||||||||||||||||
| 283 | return executed 1 time by 1 test: 0;return 0;Executed by:
executed 1 time by 1 test: return 0;Executed by:
| 1 | ||||||||||||||||||||||||
| 284 | break; executed 76 times by 1 test: break;Executed by:
| 76 | ||||||||||||||||||||||||
| 285 | case executed 70 times by 1 test: 'E':case 'E':Executed by:
executed 70 times by 1 test: case 'E':Executed by:
| 70 | ||||||||||||||||||||||||
| 286 | flags |= (1 << 5); | - | ||||||||||||||||||||||||
| 287 | - | |||||||||||||||||||||||||
| 288 | case executed 70 times by 1 test: 'e':case 'e':Executed by:
executed 70 times by 1 test: case 'e':Executed by:
code before this statement executed 70 times by 1 test: case 'e':Executed by:
| 70 | ||||||||||||||||||||||||
| 289 | if (cflags == 3
| 0-140 | ||||||||||||||||||||||||
| 290 | fvalue = never executed: fvalue = __builtin_va_arg( args , double ) ; | 0 | ||||||||||||||||||||||||
| 291 | __builtin_va_arg( never executed: fvalue = __builtin_va_arg( args , double ) ; | 0 | ||||||||||||||||||||||||
| 292 | args never executed: fvalue = __builtin_va_arg( args , double ) ; | 0 | ||||||||||||||||||||||||
| 293 | , never executed: fvalue = __builtin_va_arg( args , double ) ; | 0 | ||||||||||||||||||||||||
| 294 | double never executed: fvalue = __builtin_va_arg( args , double ) ; | 0 | ||||||||||||||||||||||||
| 295 | ) never executed: fvalue = __builtin_va_arg( args , double ) ; | 0 | ||||||||||||||||||||||||
| 296 | ; never executed: fvalue = __builtin_va_arg( args , double ) ; | 0 | ||||||||||||||||||||||||
| 297 | else | - | ||||||||||||||||||||||||
| 298 | fvalue = executed 140 times by 1 test: fvalue = __builtin_va_arg( args , double ) ;Executed by:
| 140 | ||||||||||||||||||||||||
| 299 | __builtin_va_arg( executed 140 times by 1 test: fvalue = __builtin_va_arg( args , double ) ;Executed by:
| 140 | ||||||||||||||||||||||||
| 300 | args executed 140 times by 1 test: fvalue = __builtin_va_arg( args , double ) ;Executed by:
| 140 | ||||||||||||||||||||||||
| 301 | , executed 140 times by 1 test: fvalue = __builtin_va_arg( args , double ) ;Executed by:
| 140 | ||||||||||||||||||||||||
| 302 | double executed 140 times by 1 test: fvalue = __builtin_va_arg( args , double ) ;Executed by:
| 140 | ||||||||||||||||||||||||
| 303 | ) executed 140 times by 1 test: fvalue = __builtin_va_arg( args , double ) ;Executed by:
| 140 | ||||||||||||||||||||||||
| 304 | ; executed 140 times by 1 test: fvalue = __builtin_va_arg( args , double ) ;Executed by:
| 140 | ||||||||||||||||||||||||
| 305 | if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max,
| 0-140 | ||||||||||||||||||||||||
| 306 | flags, 1)
| 0-140 | ||||||||||||||||||||||||
| 307 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 308 | break; executed 140 times by 1 test: break;Executed by:
| 140 | ||||||||||||||||||||||||
| 309 | case executed 70 times by 1 test: 'G':case 'G':Executed by:
executed 70 times by 1 test: case 'G':Executed by:
| 70 | ||||||||||||||||||||||||
| 310 | flags |= (1 << 5); | - | ||||||||||||||||||||||||
| 311 | - | |||||||||||||||||||||||||
| 312 | case executed 70 times by 1 test: 'g':case 'g':Executed by:
executed 70 times by 1 test: case 'g':Executed by:
code before this statement executed 70 times by 1 test: case 'g':Executed by:
| 70 | ||||||||||||||||||||||||
| 313 | if (cflags == 3
| 0-140 | ||||||||||||||||||||||||
| 314 | fvalue = never executed: fvalue = __builtin_va_arg( args , double ) ; | 0 | ||||||||||||||||||||||||
| 315 | __builtin_va_arg( never executed: fvalue = __builtin_va_arg( args , double ) ; | 0 | ||||||||||||||||||||||||
| 316 | args never executed: fvalue = __builtin_va_arg( args , double ) ; | 0 | ||||||||||||||||||||||||
| 317 | , never executed: fvalue = __builtin_va_arg( args , double ) ; | 0 | ||||||||||||||||||||||||
| 318 | double never executed: fvalue = __builtin_va_arg( args , double ) ; | 0 | ||||||||||||||||||||||||
| 319 | ) never executed: fvalue = __builtin_va_arg( args , double ) ; | 0 | ||||||||||||||||||||||||
| 320 | ; never executed: fvalue = __builtin_va_arg( args , double ) ; | 0 | ||||||||||||||||||||||||
| 321 | else | - | ||||||||||||||||||||||||
| 322 | fvalue = executed 140 times by 1 test: fvalue = __builtin_va_arg( args , double ) ;Executed by:
| 140 | ||||||||||||||||||||||||
| 323 | __builtin_va_arg( executed 140 times by 1 test: fvalue = __builtin_va_arg( args , double ) ;Executed by:
| 140 | ||||||||||||||||||||||||
| 324 | args executed 140 times by 1 test: fvalue = __builtin_va_arg( args , double ) ;Executed by:
| 140 | ||||||||||||||||||||||||
| 325 | , executed 140 times by 1 test: fvalue = __builtin_va_arg( args , double ) ;Executed by:
| 140 | ||||||||||||||||||||||||
| 326 | double executed 140 times by 1 test: fvalue = __builtin_va_arg( args , double ) ;Executed by:
| 140 | ||||||||||||||||||||||||
| 327 | ) executed 140 times by 1 test: fvalue = __builtin_va_arg( args , double ) ;Executed by:
| 140 | ||||||||||||||||||||||||
| 328 | ; executed 140 times by 1 test: fvalue = __builtin_va_arg( args , double ) ;Executed by:
| 140 | ||||||||||||||||||||||||
| 329 | if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max,
| 0-140 | ||||||||||||||||||||||||
| 330 | flags, 2)
| 0-140 | ||||||||||||||||||||||||
| 331 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 332 | break; executed 140 times by 1 test: break;Executed by:
| 140 | ||||||||||||||||||||||||
| 333 | case executed 84071 times by 1 test: 'c':case 'c':Executed by:
executed 84071 times by 1 test: case 'c':Executed by:
| 84071 | ||||||||||||||||||||||||
| 334 | if (!doapr_outch(sbuffer, buffer, &currlen, maxlen,
| 0-84071 | ||||||||||||||||||||||||
| 335 |
| 0-84071 | ||||||||||||||||||||||||
| 336 | __builtin_va_arg(
| 0-84071 | ||||||||||||||||||||||||
| 337 | args
| 0-84071 | ||||||||||||||||||||||||
| 338 | ,
| 0-84071 | ||||||||||||||||||||||||
| 339 | int
| 0-84071 | ||||||||||||||||||||||||
| 340 | )
| 0-84071 | ||||||||||||||||||||||||
| 341 | )
| 0-84071 | ||||||||||||||||||||||||
| 342 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 343 | break; executed 84071 times by 1 test: break;Executed by:
| 84071 | ||||||||||||||||||||||||
| 344 | case executed 2472428 times by 12 tests: 's':case 's':Executed by:
executed 2472428 times by 12 tests: case 's':Executed by:
| 2472428 | ||||||||||||||||||||||||
| 345 | strvalue = | - | ||||||||||||||||||||||||
| 346 | __builtin_va_arg( | - | ||||||||||||||||||||||||
| 347 | args | - | ||||||||||||||||||||||||
| 348 | , | - | ||||||||||||||||||||||||
| 349 | char * | - | ||||||||||||||||||||||||
| 350 | ) | - | ||||||||||||||||||||||||
| 351 | ; | - | ||||||||||||||||||||||||
| 352 | if (max < 0
| 6817-2465611 | ||||||||||||||||||||||||
| 353 | if (buffer
| 44630-2420981 | ||||||||||||||||||||||||
| 354 | max = 0x7fffffff; executed 2420981 times by 12 tests: max = 0x7fffffff;Executed by:
| 2420981 | ||||||||||||||||||||||||
| 355 | else | - | ||||||||||||||||||||||||
| 356 | max = *maxlen; executed 44630 times by 1 test: max = *maxlen;Executed by:
| 44630 | ||||||||||||||||||||||||
| 357 | } | - | ||||||||||||||||||||||||
| 358 | if (!fmtstr(sbuffer, buffer, &currlen, maxlen, strvalue,
| 0-2472428 | ||||||||||||||||||||||||
| 359 | flags, min, max)
| 0-2472428 | ||||||||||||||||||||||||
| 360 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 361 | break; executed 2472428 times by 12 tests: break;Executed by:
| 2472428 | ||||||||||||||||||||||||
| 362 | case executed 13 times by 1 test: 'p':case 'p':Executed by:
executed 13 times by 1 test: case 'p':Executed by:
| 13 | ||||||||||||||||||||||||
| 363 | value = (size_t) | - | ||||||||||||||||||||||||
| 364 | __builtin_va_arg( | - | ||||||||||||||||||||||||
| 365 | args | - | ||||||||||||||||||||||||
| 366 | , | - | ||||||||||||||||||||||||
| 367 | void * | - | ||||||||||||||||||||||||
| 368 | ) | - | ||||||||||||||||||||||||
| 369 | ; | - | ||||||||||||||||||||||||
| 370 | if (!fmtint(sbuffer, buffer, &currlen, maxlen,
| 0-13 | ||||||||||||||||||||||||
| 371 | value, 16, min, max, flags | (1 << 3))
| 0-13 | ||||||||||||||||||||||||
| 372 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 373 | break; executed 13 times by 1 test: break;Executed by:
| 13 | ||||||||||||||||||||||||
| 374 | case never executed: 'n':case 'n':never executed: case 'n': | 0 | ||||||||||||||||||||||||
| 375 | { | - | ||||||||||||||||||||||||
| 376 | int *num; | - | ||||||||||||||||||||||||
| 377 | num = | - | ||||||||||||||||||||||||
| 378 | __builtin_va_arg( | - | ||||||||||||||||||||||||
| 379 | args | - | ||||||||||||||||||||||||
| 380 | , | - | ||||||||||||||||||||||||
| 381 | int * | - | ||||||||||||||||||||||||
| 382 | ) | - | ||||||||||||||||||||||||
| 383 | ; | - | ||||||||||||||||||||||||
| 384 | *num = currlen; | - | ||||||||||||||||||||||||
| 385 | } | - | ||||||||||||||||||||||||
| 386 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 387 | case executed 350 times by 1 test: '%':case '%':Executed by:
executed 350 times by 1 test: case '%':Executed by:
| 350 | ||||||||||||||||||||||||
| 388 | if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch)
| 0-350 | ||||||||||||||||||||||||
| 389 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 390 | break; executed 350 times by 1 test: break;Executed by:
| 350 | ||||||||||||||||||||||||
| 391 | case never executed: 'w':case 'w':never executed: case 'w': | 0 | ||||||||||||||||||||||||
| 392 | - | |||||||||||||||||||||||||
| 393 | ch = *format++; | - | ||||||||||||||||||||||||
| 394 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 395 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||
| 396 | - | |||||||||||||||||||||||||
| 397 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 398 | } | - | ||||||||||||||||||||||||
| 399 | ch = *format++; | - | ||||||||||||||||||||||||
| 400 | state = 0; | - | ||||||||||||||||||||||||
| 401 | flags = cflags = min = 0; | - | ||||||||||||||||||||||||
| 402 | max = -1; | - | ||||||||||||||||||||||||
| 403 | break; executed 12102491 times by 12 tests: break;Executed by:
| 12102491 | ||||||||||||||||||||||||
| 404 | case executed 8876302 times by 12 tests: 7:case 7:Executed by:
executed 8876302 times by 12 tests: case 7:Executed by:
| 8876302 | ||||||||||||||||||||||||
| 405 | break; executed 8876302 times by 12 tests: break;Executed by:
| 8876302 | ||||||||||||||||||||||||
| 406 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||
| 407 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 408 | } | - | ||||||||||||||||||||||||
| 409 | } | - | ||||||||||||||||||||||||
| 410 | - | |||||||||||||||||||||||||
| 411 | - | |||||||||||||||||||||||||
| 412 | - | |||||||||||||||||||||||||
| 413 | - | |||||||||||||||||||||||||
| 414 | if (buffer ==
| 693766-8182536 | ||||||||||||||||||||||||
| 415 | ((void *)0)
| 693766-8182536 | ||||||||||||||||||||||||
| 416 | ) { | - | ||||||||||||||||||||||||
| 417 | *truncated = (currlen > *maxlen - 1); | - | ||||||||||||||||||||||||
| 418 | if (*
| 0-693766 | ||||||||||||||||||||||||
| 419 | currlen = *maxlen - 1; never executed: currlen = *maxlen - 1; | 0 | ||||||||||||||||||||||||
| 420 | } executed 693766 times by 1 test: end of blockExecuted by:
| 693766 | ||||||||||||||||||||||||
| 421 | if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, '\0')
| 0-8876302 | ||||||||||||||||||||||||
| 422 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 423 | *retlen = currlen - 1; | - | ||||||||||||||||||||||||
| 424 | return executed 8876302 times by 12 tests: 1;return 1;Executed by:
executed 8876302 times by 12 tests: return 1;Executed by:
| 8876302 | ||||||||||||||||||||||||
| 425 | } | - | ||||||||||||||||||||||||
| 426 | - | |||||||||||||||||||||||||
| 427 | static int | - | ||||||||||||||||||||||||
| 428 | fmtstr(char **sbuffer, | - | ||||||||||||||||||||||||
| 429 | char **buffer, | - | ||||||||||||||||||||||||
| 430 | size_t *currlen, | - | ||||||||||||||||||||||||
| 431 | size_t *maxlen, const char *value, int flags, int min, int max) | - | ||||||||||||||||||||||||
| 432 | { | - | ||||||||||||||||||||||||
| 433 | int padlen; | - | ||||||||||||||||||||||||
| 434 | size_t strln; | - | ||||||||||||||||||||||||
| 435 | int cnt = 0; | - | ||||||||||||||||||||||||
| 436 | - | |||||||||||||||||||||||||
| 437 | if (value == 0
| 2641-2469787 | ||||||||||||||||||||||||
| 438 | value = "<NULL>"; executed 2641 times by 1 test: value = "<NULL>";Executed by:
| 2641 | ||||||||||||||||||||||||
| 439 | - | |||||||||||||||||||||||||
| 440 | strln = OPENSSL_strnlen(value, max < 0 ? | - | ||||||||||||||||||||||||
| 441 | (18446744073709551615UL) | - | ||||||||||||||||||||||||
| 442 | : (size_t)max); | - | ||||||||||||||||||||||||
| 443 | - | |||||||||||||||||||||||||
| 444 | padlen = min - strln; | - | ||||||||||||||||||||||||
| 445 | if (min < 0
| 0-2472428 | ||||||||||||||||||||||||
| 446 | padlen = 0; executed 573757 times by 12 tests: padlen = 0;Executed by:
| 573757 | ||||||||||||||||||||||||
| 447 | if (max >= 0
| 0-2472428 | ||||||||||||||||||||||||
| 448 | - | |||||||||||||||||||||||||
| 449 | - | |||||||||||||||||||||||||
| 450 | - | |||||||||||||||||||||||||
| 451 | - | |||||||||||||||||||||||||
| 452 | if (max < 0x7fffffff - padlen
| 51447-2420981 | ||||||||||||||||||||||||
| 453 | max += padlen; executed 51447 times by 1 test: max += padlen;Executed by:
| 51447 | ||||||||||||||||||||||||
| 454 | else | - | ||||||||||||||||||||||||
| 455 | max = 0x7fffffff; executed 2420981 times by 12 tests: max = 0x7fffffff;Executed by:
| 2420981 | ||||||||||||||||||||||||
| 456 | } | - | ||||||||||||||||||||||||
| 457 | if (flags & (1 << 0)
| 1043542-1428886 | ||||||||||||||||||||||||
| 458 | padlen = -padlen; executed 1428886 times by 1 test: padlen = -padlen;Executed by:
| 1428886 | ||||||||||||||||||||||||
| 459 | - | |||||||||||||||||||||||||
| 460 | while ((
| 0-4048071 | ||||||||||||||||||||||||
| 461 | if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' ')
| 0-4048071 | ||||||||||||||||||||||||
| 462 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 463 | --padlen; | - | ||||||||||||||||||||||||
| 464 | ++cnt; | - | ||||||||||||||||||||||||
| 465 | } executed 4048071 times by 12 tests: end of blockExecuted by:
| 4048071 | ||||||||||||||||||||||||
| 466 | while (strln > 0
| 0-13566703 | ||||||||||||||||||||||||
| 467 | if (!doapr_outch(sbuffer, buffer, currlen, maxlen, *value++)
| 0-13566703 | ||||||||||||||||||||||||
| 468 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 469 | --strln; | - | ||||||||||||||||||||||||
| 470 | ++cnt; | - | ||||||||||||||||||||||||
| 471 | } executed 13566703 times by 12 tests: end of blockExecuted by:
| 13566703 | ||||||||||||||||||||||||
| 472 | while ((
| 0-15300961 | ||||||||||||||||||||||||
| 473 | if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' ')
| 0-15300961 | ||||||||||||||||||||||||
| 474 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 475 | ++padlen; | - | ||||||||||||||||||||||||
| 476 | ++cnt; | - | ||||||||||||||||||||||||
| 477 | } executed 15300961 times by 1 test: end of blockExecuted by:
| 15300961 | ||||||||||||||||||||||||
| 478 | return executed 2472428 times by 12 tests: 1;return 1;Executed by:
executed 2472428 times by 12 tests: return 1;Executed by:
| 2472428 | ||||||||||||||||||||||||
| 479 | } | - | ||||||||||||||||||||||||
| 480 | - | |||||||||||||||||||||||||
| 481 | static int | - | ||||||||||||||||||||||||
| 482 | fmtint(char **sbuffer, | - | ||||||||||||||||||||||||
| 483 | char **buffer, | - | ||||||||||||||||||||||||
| 484 | size_t *currlen, | - | ||||||||||||||||||||||||
| 485 | size_t *maxlen, int64_t value, int base, int min, int max, int flags) | - | ||||||||||||||||||||||||
| 486 | { | - | ||||||||||||||||||||||||
| 487 | int signvalue = 0; | - | ||||||||||||||||||||||||
| 488 | const char *prefix = ""; | - | ||||||||||||||||||||||||
| 489 | uint64_t uvalue; | - | ||||||||||||||||||||||||
| 490 | char convert[((sizeof(value)*8+2)/3+1) + 3]; | - | ||||||||||||||||||||||||
| 491 | int place = 0; | - | ||||||||||||||||||||||||
| 492 | int spadlen = 0; | - | ||||||||||||||||||||||||
| 493 | int zpadlen = 0; | - | ||||||||||||||||||||||||
| 494 | int caps = 0; | - | ||||||||||||||||||||||||
| 495 | - | |||||||||||||||||||||||||
| 496 | if (max < 0
| 0-9545286 | ||||||||||||||||||||||||
| 497 | max = 0; executed 9545286 times by 11 tests: max = 0;Executed by:
| 9545286 | ||||||||||||||||||||||||
| 498 | uvalue = value; | - | ||||||||||||||||||||||||
| 499 | if (!(flags & (1 << 6))
| 3904006-5641280 | ||||||||||||||||||||||||
| 500 | if (value < 0
| 676-5640604 | ||||||||||||||||||||||||
| 501 | signvalue = '-'; | - | ||||||||||||||||||||||||
| 502 | uvalue = 0 - (uint64_t)value; | - | ||||||||||||||||||||||||
| 503 | } executed 676 times by 1 test: else if (flags & (1 << 1)end of blockExecuted by:
| 0-5640604 | ||||||||||||||||||||||||
| 504 | signvalue = '+'; never executed: signvalue = '+'; | 0 | ||||||||||||||||||||||||
| 505 | else if (flags & (1 << 2)
| 170-5640434 | ||||||||||||||||||||||||
| 506 | signvalue = ' '; executed 170 times by 1 test: signvalue = ' ';Executed by:
| 170 | ||||||||||||||||||||||||
| 507 | } executed 5641280 times by 11 tests: end of blockExecuted by:
| 5641280 | ||||||||||||||||||||||||
| 508 | if (flags & (1 << 3)
| 13-9545273 | ||||||||||||||||||||||||
| 509 | if (base == 8
| 0-13 | ||||||||||||||||||||||||
| 510 | prefix = "0"; never executed: prefix = "0"; | 0 | ||||||||||||||||||||||||
| 511 | if (base == 16
| 0-13 | ||||||||||||||||||||||||
| 512 | prefix = "0x"; executed 13 times by 1 test: prefix = "0x";Executed by:
| 13 | ||||||||||||||||||||||||
| 513 | } executed 13 times by 1 test: end of blockExecuted by:
| 13 | ||||||||||||||||||||||||
| 514 | if (flags & (1 << 5)
| 3015980-6529306 | ||||||||||||||||||||||||
| 515 | caps = 1; executed 3015980 times by 1 test: caps = 1;Executed by:
| 3015980 | ||||||||||||||||||||||||
| 516 | do { | - | ||||||||||||||||||||||||
| 517 | convert[place++] = (caps
| 4501188-11837074 | ||||||||||||||||||||||||
| 518 | [uvalue % (unsigned)base]; | - | ||||||||||||||||||||||||
| 519 | uvalue = (uvalue / (unsigned)base); | - | ||||||||||||||||||||||||
| 520 | } executed 16338262 times by 11 tests: while (uvalueend of blockExecuted by:
| 0-16338262 | ||||||||||||||||||||||||
| 521 | if (place == sizeof(convert)
| 0-9545286 | ||||||||||||||||||||||||
| 522 | place--; never executed: place--; | 0 | ||||||||||||||||||||||||
| 523 | convert[place] = 0; | - | ||||||||||||||||||||||||
| 524 | - | |||||||||||||||||||||||||
| 525 | zpadlen = max - place; | - | ||||||||||||||||||||||||
| 526 | spadlen = | - | ||||||||||||||||||||||||
| 527 | min - ((
| 0-9545286 | ||||||||||||||||||||||||
| 528 | if (zpadlen < 0
| 0-9545286 | ||||||||||||||||||||||||
| 529 | zpadlen = 0; executed 9545286 times by 11 tests: zpadlen = 0;Executed by:
| 9545286 | ||||||||||||||||||||||||
| 530 | if (spadlen < 0
| 1988699-7556587 | ||||||||||||||||||||||||
| 531 | spadlen = 0; executed 1988699 times by 11 tests: spadlen = 0;Executed by:
| 1988699 | ||||||||||||||||||||||||
| 532 | if (flags & (1 << 4)
| 3565471-5979815 | ||||||||||||||||||||||||
| 533 | zpadlen = ((
| 1750806-1814665 | ||||||||||||||||||||||||
| 534 | spadlen = 0; | - | ||||||||||||||||||||||||
| 535 | } executed 3565471 times by 1 test: end of blockExecuted by:
| 3565471 | ||||||||||||||||||||||||
| 536 | if (flags & (1 << 0)
| 1428656-8116630 | ||||||||||||||||||||||||
| 537 | spadlen = -spadlen; executed 1428656 times by 1 test: spadlen = -spadlen;Executed by:
| 1428656 | ||||||||||||||||||||||||
| 538 | - | |||||||||||||||||||||||||
| 539 | - | |||||||||||||||||||||||||
| 540 | while (spadlen > 0
| 5124734-9545286 | ||||||||||||||||||||||||
| 541 | if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' ')
| 0-5124734 | ||||||||||||||||||||||||
| 542 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 543 | --spadlen; | - | ||||||||||||||||||||||||
| 544 | } executed 5124734 times by 1 test: end of blockExecuted by:
| 5124734 | ||||||||||||||||||||||||
| 545 | - | |||||||||||||||||||||||||
| 546 | - | |||||||||||||||||||||||||
| 547 | if (signvalue
| 846-9544440 | ||||||||||||||||||||||||
| 548 | if (!doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue)
| 0-846 | ||||||||||||||||||||||||
| 549 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 550 | - | |||||||||||||||||||||||||
| 551 | - | |||||||||||||||||||||||||
| 552 | while (*
| 26-9545286 | ||||||||||||||||||||||||
| 553 | if (!doapr_outch(sbuffer, buffer, currlen, maxlen, *prefix)
| 0-26 | ||||||||||||||||||||||||
| 554 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 555 | prefix++; | - | ||||||||||||||||||||||||
| 556 | } executed 26 times by 1 test: end of blockExecuted by:
| 26 | ||||||||||||||||||||||||
| 557 | - | |||||||||||||||||||||||||
| 558 | - | |||||||||||||||||||||||||
| 559 | if (zpadlen > 0
| 1814665-7730621 | ||||||||||||||||||||||||
| 560 | while (zpadlen > 0
| 1814665-1831390 | ||||||||||||||||||||||||
| 561 | if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '0')
| 0-1831390 | ||||||||||||||||||||||||
| 562 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 563 | --zpadlen; | - | ||||||||||||||||||||||||
| 564 | } executed 1831390 times by 1 test: end of blockExecuted by:
| 1831390 | ||||||||||||||||||||||||
| 565 | } executed 1814665 times by 1 test: end of blockExecuted by:
| 1814665 | ||||||||||||||||||||||||
| 566 | - | |||||||||||||||||||||||||
| 567 | while (place > 0
| 9545286-16338262 | ||||||||||||||||||||||||
| 568 | if (!doapr_outch(sbuffer, buffer, currlen, maxlen, convert[--place])
| 0-16338262 | ||||||||||||||||||||||||
| 569 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 570 | } executed 16338262 times by 11 tests: end of blockExecuted by:
| 16338262 | ||||||||||||||||||||||||
| 571 | - | |||||||||||||||||||||||||
| 572 | - | |||||||||||||||||||||||||
| 573 | while (spadlen < 0
| 1416222-9545286 | ||||||||||||||||||||||||
| 574 | if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' ')
| 0-1416222 | ||||||||||||||||||||||||
| 575 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 576 | ++spadlen; | - | ||||||||||||||||||||||||
| 577 | } executed 1416222 times by 1 test: end of blockExecuted by:
| 1416222 | ||||||||||||||||||||||||
| 578 | return executed 9545286 times by 11 tests: 1;return 1;Executed by:
executed 9545286 times by 11 tests: return 1;Executed by:
| 9545286 | ||||||||||||||||||||||||
| 579 | } | - | ||||||||||||||||||||||||
| 580 | - | |||||||||||||||||||||||||
| 581 | static double abs_val(double value) | - | ||||||||||||||||||||||||
| 582 | { | - | ||||||||||||||||||||||||
| 583 | double result = value; | - | ||||||||||||||||||||||||
| 584 | if (value < 0
| 0-357 | ||||||||||||||||||||||||
| 585 | result = -value; never executed: result = -value; | 0 | ||||||||||||||||||||||||
| 586 | return executed 357 times by 1 test: result;return result;Executed by:
executed 357 times by 1 test: return result;Executed by:
| 357 | ||||||||||||||||||||||||
| 587 | } | - | ||||||||||||||||||||||||
| 588 | - | |||||||||||||||||||||||||
| 589 | static double pow_10(int in_exp) | - | ||||||||||||||||||||||||
| 590 | { | - | ||||||||||||||||||||||||
| 591 | double result = 1; | - | ||||||||||||||||||||||||
| 592 | while (in_exp
| 808-3008 | ||||||||||||||||||||||||
| 593 | result *= 10; | - | ||||||||||||||||||||||||
| 594 | in_exp--; | - | ||||||||||||||||||||||||
| 595 | } executed 3008 times by 1 test: end of blockExecuted by:
| 3008 | ||||||||||||||||||||||||
| 596 | return executed 808 times by 1 test: result;return result;Executed by:
executed 808 times by 1 test: return result;Executed by:
| 808 | ||||||||||||||||||||||||
| 597 | } | - | ||||||||||||||||||||||||
| 598 | - | |||||||||||||||||||||||||
| 599 | static long roundv(double value) | - | ||||||||||||||||||||||||
| 600 | { | - | ||||||||||||||||||||||||
| 601 | long intpart; | - | ||||||||||||||||||||||||
| 602 | intpart = (long)value; | - | ||||||||||||||||||||||||
| 603 | value = value - intpart; | - | ||||||||||||||||||||||||
| 604 | if (value >= 0.5
| 284-428 | ||||||||||||||||||||||||
| 605 | intpart++; executed 284 times by 1 test: intpart++;Executed by:
| 284 | ||||||||||||||||||||||||
| 606 | return executed 712 times by 1 test: intpart;return intpart;Executed by:
executed 712 times by 1 test: return intpart;Executed by:
| 712 | ||||||||||||||||||||||||
| 607 | } | - | ||||||||||||||||||||||||
| 608 | - | |||||||||||||||||||||||||
| 609 | static int | - | ||||||||||||||||||||||||
| 610 | fmtfp(char **sbuffer, | - | ||||||||||||||||||||||||
| 611 | char **buffer, | - | ||||||||||||||||||||||||
| 612 | size_t *currlen, | - | ||||||||||||||||||||||||
| 613 | size_t *maxlen, double fvalue, int min, int max, int flags, int style) | - | ||||||||||||||||||||||||
| 614 | { | - | ||||||||||||||||||||||||
| 615 | int signvalue = 0; | - | ||||||||||||||||||||||||
| 616 | double ufvalue; | - | ||||||||||||||||||||||||
| 617 | double tmpvalue; | - | ||||||||||||||||||||||||
| 618 | char iconvert[20]; | - | ||||||||||||||||||||||||
| 619 | char fconvert[20]; | - | ||||||||||||||||||||||||
| 620 | char econvert[20]; | - | ||||||||||||||||||||||||
| 621 | int iplace = 0; | - | ||||||||||||||||||||||||
| 622 | int fplace = 0; | - | ||||||||||||||||||||||||
| 623 | int eplace = 0; | - | ||||||||||||||||||||||||
| 624 | int padlen = 0; | - | ||||||||||||||||||||||||
| 625 | int zpadlen = 0; | - | ||||||||||||||||||||||||
| 626 | long exp = 0; | - | ||||||||||||||||||||||||
| 627 | unsigned long intpart; | - | ||||||||||||||||||||||||
| 628 | unsigned long fracpart; | - | ||||||||||||||||||||||||
| 629 | unsigned long max10; | - | ||||||||||||||||||||||||
| 630 | int realstyle; | - | ||||||||||||||||||||||||
| 631 | - | |||||||||||||||||||||||||
| 632 | if (max < 0
| 51-306 | ||||||||||||||||||||||||
| 633 | max = 6; executed 51 times by 1 test: max = 6;Executed by:
| 51 | ||||||||||||||||||||||||
| 634 | - | |||||||||||||||||||||||||
| 635 | if (fvalue < 0
| 0-357 | ||||||||||||||||||||||||
| 636 | signvalue = '-'; never executed: signvalue = '-'; | 0 | ||||||||||||||||||||||||
| 637 | else if (flags & (1 << 1)
| 0-357 | ||||||||||||||||||||||||
| 638 | signvalue = '+'; never executed: signvalue = '+'; | 0 | ||||||||||||||||||||||||
| 639 | else if (flags & (1 << 2)
| 0-357 | ||||||||||||||||||||||||
| 640 | signvalue = ' '; never executed: signvalue = ' '; | 0 | ||||||||||||||||||||||||
| 641 | - | |||||||||||||||||||||||||
| 642 | - | |||||||||||||||||||||||||
| 643 | - | |||||||||||||||||||||||||
| 644 | - | |||||||||||||||||||||||||
| 645 | - | |||||||||||||||||||||||||
| 646 | - | |||||||||||||||||||||||||
| 647 | if (style == 2
| 140-217 | ||||||||||||||||||||||||
| 648 | if (fvalue == 0.0
| 14-126 | ||||||||||||||||||||||||
| 649 | realstyle = 0; | - | ||||||||||||||||||||||||
| 650 | } executed 14 times by 1 test: else if (fvalue < 0.0001end of blockExecuted by:
| 14-112 | ||||||||||||||||||||||||
| 651 | realstyle = 1; | - | ||||||||||||||||||||||||
| 652 | } executed 14 times by 1 test: else if ((max == 0end of blockExecuted by:
| 8-96 | ||||||||||||||||||||||||
| 653 | || (max > 0
| 6-96 | ||||||||||||||||||||||||
| 654 | realstyle = 1; | - | ||||||||||||||||||||||||
| 655 | } executed 14 times by 1 test: else {end of blockExecuted by:
| 14 | ||||||||||||||||||||||||
| 656 | realstyle = 0; | - | ||||||||||||||||||||||||
| 657 | } executed 98 times by 1 test: end of blockExecuted by:
| 98 | ||||||||||||||||||||||||
| 658 | } else { | - | ||||||||||||||||||||||||
| 659 | realstyle = style; | - | ||||||||||||||||||||||||
| 660 | } executed 217 times by 1 test: end of blockExecuted by:
| 217 | ||||||||||||||||||||||||
| 661 | - | |||||||||||||||||||||||||
| 662 | if (style != 0
| 77-280 | ||||||||||||||||||||||||
| 663 | tmpvalue = fvalue; | - | ||||||||||||||||||||||||
| 664 | - | |||||||||||||||||||||||||
| 665 | if (fvalue != 0.0
| 28-252 | ||||||||||||||||||||||||
| 666 | while (tmpvalue < 1
| 252-308 | ||||||||||||||||||||||||
| 667 | tmpvalue *= 10; | - | ||||||||||||||||||||||||
| 668 | exp--; | - | ||||||||||||||||||||||||
| 669 | } executed 308 times by 1 test: end of blockExecuted by:
| 308 | ||||||||||||||||||||||||
| 670 | while (tmpvalue > 10
| 252-280 | ||||||||||||||||||||||||
| 671 | tmpvalue /= 10; | - | ||||||||||||||||||||||||
| 672 | exp++; | - | ||||||||||||||||||||||||
| 673 | } executed 280 times by 1 test: end of blockExecuted by:
| 280 | ||||||||||||||||||||||||
| 674 | } executed 252 times by 1 test: end of blockExecuted by:
| 252 | ||||||||||||||||||||||||
| 675 | if (style == 2
| 140 | ||||||||||||||||||||||||
| 676 | - | |||||||||||||||||||||||||
| 677 | - | |||||||||||||||||||||||||
| 678 | - | |||||||||||||||||||||||||
| 679 | - | |||||||||||||||||||||||||
| 680 | if (max == 0
| 20-120 | ||||||||||||||||||||||||
| 681 | max = 1; executed 20 times by 1 test: max = 1;Executed by:
| 20 | ||||||||||||||||||||||||
| 682 | - | |||||||||||||||||||||||||
| 683 | if (realstyle == 0
| 28-112 | ||||||||||||||||||||||||
| 684 | max -= (exp + 1); | - | ||||||||||||||||||||||||
| 685 | if (max < 0
| 0-112 | ||||||||||||||||||||||||
| 686 | - | |||||||||||||||||||||||||
| 687 | - | |||||||||||||||||||||||||
| 688 | - | |||||||||||||||||||||||||
| 689 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 690 | } | - | ||||||||||||||||||||||||
| 691 | } executed 112 times by 1 test: else {end of blockExecuted by:
| 112 | ||||||||||||||||||||||||
| 692 | - | |||||||||||||||||||||||||
| 693 | - | |||||||||||||||||||||||||
| 694 | - | |||||||||||||||||||||||||
| 695 | - | |||||||||||||||||||||||||
| 696 | - | |||||||||||||||||||||||||
| 697 | max--; | - | ||||||||||||||||||||||||
| 698 | } executed 28 times by 1 test: end of blockExecuted by:
| 28 | ||||||||||||||||||||||||
| 699 | } | - | ||||||||||||||||||||||||
| 700 | if (realstyle == 1
| 112-168 | ||||||||||||||||||||||||
| 701 | fvalue = tmpvalue; executed 168 times by 1 test: fvalue = tmpvalue;Executed by:
| 168 | ||||||||||||||||||||||||
| 702 | } executed 280 times by 1 test: end of blockExecuted by:
| 280 | ||||||||||||||||||||||||
| 703 | ufvalue = abs_val(fvalue); | - | ||||||||||||||||||||||||
| 704 | if (ufvalue >
| 1-356 | ||||||||||||||||||||||||
| 705 | (0x7fffffffffffffffL * 2UL + 1UL)
| 1-356 | ||||||||||||||||||||||||
| 706 | ) { | - | ||||||||||||||||||||||||
| 707 | - | |||||||||||||||||||||||||
| 708 | return executed 1 time by 1 test: 0;return 0;Executed by:
executed 1 time by 1 test: return 0;Executed by:
| 1 | ||||||||||||||||||||||||
| 709 | } | - | ||||||||||||||||||||||||
| 710 | intpart = (unsigned long)ufvalue; | - | ||||||||||||||||||||||||
| 711 | - | |||||||||||||||||||||||||
| 712 | - | |||||||||||||||||||||||||
| 713 | - | |||||||||||||||||||||||||
| 714 | - | |||||||||||||||||||||||||
| 715 | - | |||||||||||||||||||||||||
| 716 | if (max > 9
| 0-356 | ||||||||||||||||||||||||
| 717 | max = 9; never executed: max = 9; | 0 | ||||||||||||||||||||||||
| 718 | - | |||||||||||||||||||||||||
| 719 | - | |||||||||||||||||||||||||
| 720 | - | |||||||||||||||||||||||||
| 721 | - | |||||||||||||||||||||||||
| 722 | - | |||||||||||||||||||||||||
| 723 | max10 = roundv(pow_10(max)); | - | ||||||||||||||||||||||||
| 724 | fracpart = roundv(pow_10(max) * (ufvalue - intpart)); | - | ||||||||||||||||||||||||
| 725 | - | |||||||||||||||||||||||||
| 726 | if (fracpart >= max10
| 47-309 | ||||||||||||||||||||||||
| 727 | intpart++; | - | ||||||||||||||||||||||||
| 728 | fracpart -= max10; | - | ||||||||||||||||||||||||
| 729 | } executed 47 times by 1 test: end of blockExecuted by:
| 47 | ||||||||||||||||||||||||
| 730 | - | |||||||||||||||||||||||||
| 731 | - | |||||||||||||||||||||||||
| 732 | do { | - | ||||||||||||||||||||||||
| 733 | iconvert[iplace++] = "0123456789"[intpart % 10]; | - | ||||||||||||||||||||||||
| 734 | intpart = (intpart / 10); | - | ||||||||||||||||||||||||
| 735 | } executed 522 times by 1 test: while (intpartend of blockExecuted by:
| 0-522 | ||||||||||||||||||||||||
| 736 | if (iplace == sizeof(iconvert)
| 0-356 | ||||||||||||||||||||||||
| 737 | iplace--; never executed: iplace--; | 0 | ||||||||||||||||||||||||
| 738 | iconvert[iplace] = 0; | - | ||||||||||||||||||||||||
| 739 | - | |||||||||||||||||||||||||
| 740 | - | |||||||||||||||||||||||||
| 741 | while (fplace < max
| 344-1280 | ||||||||||||||||||||||||
| 742 | if (style == 2
| 76-852 | ||||||||||||||||||||||||
| 743 | - | |||||||||||||||||||||||||
| 744 | max--; | - | ||||||||||||||||||||||||
| 745 | fracpart = fracpart / 10; | - | ||||||||||||||||||||||||
| 746 | if (fplace < max
| 12-64 | ||||||||||||||||||||||||
| 747 | continue; executed 64 times by 1 test: continue;Executed by:
| 64 | ||||||||||||||||||||||||
| 748 | break; executed 12 times by 1 test: break;Executed by:
| 12 | ||||||||||||||||||||||||
| 749 | } | - | ||||||||||||||||||||||||
| 750 | fconvert[fplace++] = "0123456789"[fracpart % 10]; | - | ||||||||||||||||||||||||
| 751 | fracpart = (fracpart / 10); | - | ||||||||||||||||||||||||
| 752 | } executed 1204 times by 1 test: end of blockExecuted by:
| 1204 | ||||||||||||||||||||||||
| 753 | - | |||||||||||||||||||||||||
| 754 | if (fplace == sizeof(fconvert)
| 0-356 | ||||||||||||||||||||||||
| 755 | fplace--; never executed: fplace--; | 0 | ||||||||||||||||||||||||
| 756 | fconvert[fplace] = 0; | - | ||||||||||||||||||||||||
| 757 | - | |||||||||||||||||||||||||
| 758 | - | |||||||||||||||||||||||||
| 759 | if (realstyle == 1
| 168-188 | ||||||||||||||||||||||||
| 760 | int tmpexp; | - | ||||||||||||||||||||||||
| 761 | if (exp < 0
| 70-98 | ||||||||||||||||||||||||
| 762 | tmpexp = -exp; executed 70 times by 1 test: tmpexp = -exp;Executed by:
| 70 | ||||||||||||||||||||||||
| 763 | else | - | ||||||||||||||||||||||||
| 764 | tmpexp = exp; executed 98 times by 1 test: tmpexp = exp;Executed by:
| 98 | ||||||||||||||||||||||||
| 765 | - | |||||||||||||||||||||||||
| 766 | do { | - | ||||||||||||||||||||||||
| 767 | econvert[eplace++] = "0123456789"[tmpexp % 10]; | - | ||||||||||||||||||||||||
| 768 | tmpexp = (tmpexp / 10); | - | ||||||||||||||||||||||||
| 769 | } executed 168 times by 1 test: while (tmpexp > 0end of blockExecuted by:
| 0-168 | ||||||||||||||||||||||||
| 770 | - | |||||||||||||||||||||||||
| 771 | if (tmpexp > 0
| 0-168 | ||||||||||||||||||||||||
| 772 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 773 | - | |||||||||||||||||||||||||
| 774 | if (eplace == 1
| 0-168 | ||||||||||||||||||||||||
| 775 | econvert[eplace++] = '0'; executed 168 times by 1 test: econvert[eplace++] = '0';Executed by:
| 168 | ||||||||||||||||||||||||
| 776 | } executed 168 times by 1 test: end of blockExecuted by:
| 168 | ||||||||||||||||||||||||
| 777 | - | |||||||||||||||||||||||||
| 778 | - | |||||||||||||||||||||||||
| 779 | - | |||||||||||||||||||||||||
| 780 | - | |||||||||||||||||||||||||
| 781 | - | |||||||||||||||||||||||||
| 782 | padlen = min - iplace - max - (max > 0
| 0-356 | ||||||||||||||||||||||||
| 783 | - | |||||||||||||||||||||||||
| 784 | if (realstyle == 1
| 168-188 | ||||||||||||||||||||||||
| 785 | padlen -= 2 + eplace; executed 168 times by 1 test: padlen -= 2 + eplace;Executed by:
| 168 | ||||||||||||||||||||||||
| 786 | zpadlen = max - fplace; | - | ||||||||||||||||||||||||
| 787 | if (zpadlen < 0
| 0-356 | ||||||||||||||||||||||||
| 788 | zpadlen = 0; never executed: zpadlen = 0; | 0 | ||||||||||||||||||||||||
| 789 | if (padlen < 0
| 128-228 | ||||||||||||||||||||||||
| 790 | padlen = 0; executed 228 times by 1 test: padlen = 0;Executed by:
| 228 | ||||||||||||||||||||||||
| 791 | if (flags & (1 << 0)
| 0-356 | ||||||||||||||||||||||||
| 792 | padlen = -padlen; never executed: padlen = -padlen; | 0 | ||||||||||||||||||||||||
| 793 | - | |||||||||||||||||||||||||
| 794 | if ((
| 21-306 | ||||||||||||||||||||||||
| 795 | if (signvalue
| 0-21 | ||||||||||||||||||||||||
| 796 | if (!doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue)
| 0 | ||||||||||||||||||||||||
| 797 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 798 | --padlen; | - | ||||||||||||||||||||||||
| 799 | signvalue = 0; | - | ||||||||||||||||||||||||
| 800 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 801 | while (padlen > 0
| 21-65 | ||||||||||||||||||||||||
| 802 | if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '0')
| 0-65 | ||||||||||||||||||||||||
| 803 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 804 | --padlen; | - | ||||||||||||||||||||||||
| 805 | } executed 65 times by 1 test: end of blockExecuted by:
| 65 | ||||||||||||||||||||||||
| 806 | } executed 21 times by 1 test: end of blockExecuted by:
| 21 | ||||||||||||||||||||||||
| 807 | while (padlen > 0
| 356-406 | ||||||||||||||||||||||||
| 808 | if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' ')
| 0-406 | ||||||||||||||||||||||||
| 809 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 810 | --padlen; | - | ||||||||||||||||||||||||
| 811 | } executed 406 times by 1 test: end of blockExecuted by:
| 406 | ||||||||||||||||||||||||
| 812 | if (signvalue
| 0-356 | ||||||||||||||||||||||||
| 813 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 814 | - | |||||||||||||||||||||||||
| 815 | while (iplace > 0
| 356-522 | ||||||||||||||||||||||||
| 816 | if (!doapr_outch(sbuffer, buffer, currlen, maxlen, iconvert[--iplace])
| 0-522 | ||||||||||||||||||||||||
| 817 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 818 | } executed 522 times by 1 test: end of blockExecuted by:
| 522 | ||||||||||||||||||||||||
| 819 | - | |||||||||||||||||||||||||
| 820 | - | |||||||||||||||||||||||||
| 821 | - | |||||||||||||||||||||||||
| 822 | - | |||||||||||||||||||||||||
| 823 | - | |||||||||||||||||||||||||
| 824 | if (max > 0
| 0-290 | ||||||||||||||||||||||||
| 825 | if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '.')
| 0-290 | ||||||||||||||||||||||||
| 826 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 827 | - | |||||||||||||||||||||||||
| 828 | while (fplace > 0
| 290-1204 | ||||||||||||||||||||||||
| 829 | if (!doapr_outch(sbuffer, buffer, currlen, maxlen,
| 0-1204 | ||||||||||||||||||||||||
| 830 | fconvert[--fplace])
| 0-1204 | ||||||||||||||||||||||||
| 831 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 832 | } executed 1204 times by 1 test: end of blockExecuted by:
| 1204 | ||||||||||||||||||||||||
| 833 | } executed 290 times by 1 test: end of blockExecuted by:
| 290 | ||||||||||||||||||||||||
| 834 | while (zpadlen > 0
| 0-356 | ||||||||||||||||||||||||
| 835 | if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '0')
| 0 | ||||||||||||||||||||||||
| 836 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 837 | --zpadlen; | - | ||||||||||||||||||||||||
| 838 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 839 | if (realstyle == 1
| 168-188 | ||||||||||||||||||||||||
| 840 | char ech; | - | ||||||||||||||||||||||||
| 841 | - | |||||||||||||||||||||||||
| 842 | if ((
| 84 | ||||||||||||||||||||||||
| 843 | ech = 'e'; executed 84 times by 1 test: ech = 'e';Executed by:
| 84 | ||||||||||||||||||||||||
| 844 | else | - | ||||||||||||||||||||||||
| 845 | ech = 'E'; executed 84 times by 1 test: ech = 'E';Executed by:
| 84 | ||||||||||||||||||||||||
| 846 | if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ech)
| 0-168 | ||||||||||||||||||||||||
| 847 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 848 | if (exp < 0
| 70-98 | ||||||||||||||||||||||||
| 849 | if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '-')
| 0-70 | ||||||||||||||||||||||||
| 850 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 851 | } executed 70 times by 1 test: else {end of blockExecuted by:
| 70 | ||||||||||||||||||||||||
| 852 | if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '+')
| 0-98 | ||||||||||||||||||||||||
| 853 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 854 | } executed 98 times by 1 test: end of blockExecuted by:
| 98 | ||||||||||||||||||||||||
| 855 | while (eplace > 0
| 168-336 | ||||||||||||||||||||||||
| 856 | if (!doapr_outch(sbuffer, buffer, currlen, maxlen,
| 0-336 | ||||||||||||||||||||||||
| 857 | econvert[--eplace])
| 0-336 | ||||||||||||||||||||||||
| 858 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 859 | } executed 336 times by 1 test: end of blockExecuted by:
| 336 | ||||||||||||||||||||||||
| 860 | } executed 168 times by 1 test: end of blockExecuted by:
| 168 | ||||||||||||||||||||||||
| 861 | - | |||||||||||||||||||||||||
| 862 | while (padlen < 0
| 0-356 | ||||||||||||||||||||||||
| 863 | if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' ')
| 0 | ||||||||||||||||||||||||
| 864 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 865 | ++padlen; | - | ||||||||||||||||||||||||
| 866 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 867 | return executed 356 times by 1 test: 1;return 1;Executed by:
executed 356 times by 1 test: return 1;Executed by:
| 356 | ||||||||||||||||||||||||
| 868 | } | - | ||||||||||||||||||||||||
| 869 | - | |||||||||||||||||||||||||
| 870 | - | |||||||||||||||||||||||||
| 871 | - | |||||||||||||||||||||||||
| 872 | static int | - | ||||||||||||||||||||||||
| 873 | doapr_outch(char **sbuffer, | - | ||||||||||||||||||||||||
| 874 | char **buffer, size_t *currlen, size_t *maxlen, int c) | - | ||||||||||||||||||||||||
| 875 | { | - | ||||||||||||||||||||||||
| 876 | - | |||||||||||||||||||||||||
| 877 | if (!((*
| 0-88059099 | ||||||||||||||||||||||||
| 878 | ((void *)0)
| 0-88059099 | ||||||||||||||||||||||||
| 879 | || buffer !=
| 0-88059099 | ||||||||||||||||||||||||
| 880 | ((void *)0)
| 0-88059099 | ||||||||||||||||||||||||
| 881 | ) != 0)
| 0-88059099 | ||||||||||||||||||||||||
| 882 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 883 | - | |||||||||||||||||||||||||
| 884 | - | |||||||||||||||||||||||||
| 885 | if (!((*currlen <= *maxlen) != 0)
| 0-88059099 | ||||||||||||||||||||||||
| 886 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 887 | - | |||||||||||||||||||||||||
| 888 | if (buffer
| 284-83340045 | ||||||||||||||||||||||||
| 889 | if (*
| 0-284 | ||||||||||||||||||||||||
| 890 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 891 | - | |||||||||||||||||||||||||
| 892 | *maxlen += 1024; | - | ||||||||||||||||||||||||
| 893 | if (*
| 88-196 | ||||||||||||||||||||||||
| 894 | ((void *)0)
| 88-196 | ||||||||||||||||||||||||
| 895 | ) { | - | ||||||||||||||||||||||||
| 896 | if ((*
| 0-88 | ||||||||||||||||||||||||
| 897 | ((void *)0)
| 0-88 | ||||||||||||||||||||||||
| 898 | ) { | - | ||||||||||||||||||||||||
| 899 | ERR_put_error(32,(150),((1|64)),__FILE__,823); | - | ||||||||||||||||||||||||
| 900 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 901 | } | - | ||||||||||||||||||||||||
| 902 | if (*
| 0-88 | ||||||||||||||||||||||||
| 903 | if (!((*sbuffer !=
| 0-88 | ||||||||||||||||||||||||
| 904 | ((void *)0)
| 0-88 | ||||||||||||||||||||||||
| 905 | ) != 0)
| 0-88 | ||||||||||||||||||||||||
| 906 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 907 | memcpy(*buffer, *sbuffer, *currlen); | - | ||||||||||||||||||||||||
| 908 | } executed 88 times by 1 test: end of blockExecuted by:
| 88 | ||||||||||||||||||||||||
| 909 | *sbuffer = | - | ||||||||||||||||||||||||
| 910 | ((void *)0) | - | ||||||||||||||||||||||||
| 911 | ; | - | ||||||||||||||||||||||||
| 912 | } executed 88 times by 1 test: else {end of blockExecuted by:
| 88 | ||||||||||||||||||||||||
| 913 | char *tmpbuf; | - | ||||||||||||||||||||||||
| 914 | tmpbuf = CRYPTO_realloc(*buffer, *maxlen, __FILE__, 834); | - | ||||||||||||||||||||||||
| 915 | if (tmpbuf ==
| 0-196 | ||||||||||||||||||||||||
| 916 | ((void *)0)
| 0-196 | ||||||||||||||||||||||||
| 917 | ) | - | ||||||||||||||||||||||||
| 918 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 919 | *buffer = tmpbuf; | - | ||||||||||||||||||||||||
| 920 | } executed 196 times by 1 test: end of blockExecuted by:
| 196 | ||||||||||||||||||||||||
| 921 | } | - | ||||||||||||||||||||||||
| 922 | - | |||||||||||||||||||||||||
| 923 | if (*
| 0-88059099 | ||||||||||||||||||||||||
| 924 | if (*
| 211574-87847525 | ||||||||||||||||||||||||
| 925 | (* executed 87847525 times by 12 tests: sbuffer)[(*currlen)++] = (char)c;(*sbuffer)[(*currlen)++] = (char)c;Executed by:
executed 87847525 times by 12 tests: (*sbuffer)[(*currlen)++] = (char)c;Executed by:
| 87847525 | ||||||||||||||||||||||||
| 926 | else | - | ||||||||||||||||||||||||
| 927 | (* executed 211574 times by 1 test: buffer)[(*currlen)++] = (char)c;(*buffer)[(*currlen)++] = (char)c;Executed by:
executed 211574 times by 1 test: (*buffer)[(*currlen)++] = (char)c;Executed by:
| 211574 | ||||||||||||||||||||||||
| 928 | } | - | ||||||||||||||||||||||||
| 929 | - | |||||||||||||||||||||||||
| 930 | return executed 88059099 times by 12 tests: 1;return 1;Executed by:
executed 88059099 times by 12 tests: return 1;Executed by:
| 88059099 | ||||||||||||||||||||||||
| 931 | } | - | ||||||||||||||||||||||||
| 932 | - | |||||||||||||||||||||||||
| 933 | - | |||||||||||||||||||||||||
| 934 | - | |||||||||||||||||||||||||
| 935 | int BIO_printf(BIO *bio, const char *format, ...) | - | ||||||||||||||||||||||||
| 936 | { | - | ||||||||||||||||||||||||
| 937 | va_list args; | - | ||||||||||||||||||||||||
| 938 | int ret; | - | ||||||||||||||||||||||||
| 939 | - | |||||||||||||||||||||||||
| 940 | - | |||||||||||||||||||||||||
| 941 | __builtin_va_start( | - | ||||||||||||||||||||||||
| 942 | args | - | ||||||||||||||||||||||||
| 943 | , | - | ||||||||||||||||||||||||
| 944 | format | - | ||||||||||||||||||||||||
| 945 | ) | - | ||||||||||||||||||||||||
| 946 | ; | - | ||||||||||||||||||||||||
| 947 | - | |||||||||||||||||||||||||
| 948 | ret = BIO_vprintf(bio, format, args); | - | ||||||||||||||||||||||||
| 949 | - | |||||||||||||||||||||||||
| 950 | - | |||||||||||||||||||||||||
| 951 | __builtin_va_end( | - | ||||||||||||||||||||||||
| 952 | args | - | ||||||||||||||||||||||||
| 953 | ) | - | ||||||||||||||||||||||||
| 954 | ; | - | ||||||||||||||||||||||||
| 955 | return executed 8142828 times by 1 test: ret;return ret;Executed by:
executed 8142828 times by 1 test: return ret;Executed by:
| 8142828 | ||||||||||||||||||||||||
| 956 | } | - | ||||||||||||||||||||||||
| 957 | - | |||||||||||||||||||||||||
| 958 | int BIO_vprintf(BIO *bio, const char *format, va_list args) | - | ||||||||||||||||||||||||
| 959 | { | - | ||||||||||||||||||||||||
| 960 | int ret; | - | ||||||||||||||||||||||||
| 961 | size_t retlen; | - | ||||||||||||||||||||||||
| 962 | char hugebuf[1024 * 2]; | - | ||||||||||||||||||||||||
| 963 | - | |||||||||||||||||||||||||
| 964 | - | |||||||||||||||||||||||||
| 965 | char *hugebufp = hugebuf; | - | ||||||||||||||||||||||||
| 966 | size_t hugebufsize = sizeof(hugebuf); | - | ||||||||||||||||||||||||
| 967 | char *dynbuf = | - | ||||||||||||||||||||||||
| 968 | ((void *)0) | - | ||||||||||||||||||||||||
| 969 | ; | - | ||||||||||||||||||||||||
| 970 | int ignored; | - | ||||||||||||||||||||||||
| 971 | - | |||||||||||||||||||||||||
| 972 | dynbuf = | - | ||||||||||||||||||||||||
| 973 | ((void *)0) | - | ||||||||||||||||||||||||
| 974 | ; | - | ||||||||||||||||||||||||
| 975 | if (!_dopr(&hugebufp, &dynbuf, &hugebufsize, &retlen, &ignored, format,
| 0-8182536 | ||||||||||||||||||||||||
| 976 | args)
| 0-8182536 | ||||||||||||||||||||||||
| 977 | CRYPTO_free(dynbuf, __FILE__, 881); | - | ||||||||||||||||||||||||
| 978 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 979 | } | - | ||||||||||||||||||||||||
| 980 | if (dynbuf
| 88-8182448 | ||||||||||||||||||||||||
| 981 | ret = BIO_write(bio, dynbuf, (int)retlen); | - | ||||||||||||||||||||||||
| 982 | CRYPTO_free(dynbuf, __FILE__, 886); | - | ||||||||||||||||||||||||
| 983 | } executed 88 times by 1 test: else {end of blockExecuted by:
| 88 | ||||||||||||||||||||||||
| 984 | ret = BIO_write(bio, hugebuf, (int)retlen); | - | ||||||||||||||||||||||||
| 985 | } executed 8182448 times by 12 tests: end of blockExecuted by:
| 8182448 | ||||||||||||||||||||||||
| 986 | return executed 8182536 times by 12 tests: ret;return ret;Executed by:
executed 8182536 times by 12 tests: return ret;Executed by:
| 8182536 | ||||||||||||||||||||||||
| 987 | } | - | ||||||||||||||||||||||||
| 988 | - | |||||||||||||||||||||||||
| 989 | - | |||||||||||||||||||||||||
| 990 | - | |||||||||||||||||||||||||
| 991 | - | |||||||||||||||||||||||||
| 992 | - | |||||||||||||||||||||||||
| 993 | - | |||||||||||||||||||||||||
| 994 | - | |||||||||||||||||||||||||
| 995 | int BIO_snprintf(char *buf, size_t n, const char *format, ...) | - | ||||||||||||||||||||||||
| 996 | { | - | ||||||||||||||||||||||||
| 997 | va_list args; | - | ||||||||||||||||||||||||
| 998 | int ret; | - | ||||||||||||||||||||||||
| 999 | - | |||||||||||||||||||||||||
| 1000 | - | |||||||||||||||||||||||||
| 1001 | __builtin_va_start( | - | ||||||||||||||||||||||||
| 1002 | args | - | ||||||||||||||||||||||||
| 1003 | , | - | ||||||||||||||||||||||||
| 1004 | format | - | ||||||||||||||||||||||||
| 1005 | ) | - | ||||||||||||||||||||||||
| 1006 | ; | - | ||||||||||||||||||||||||
| 1007 | - | |||||||||||||||||||||||||
| 1008 | ret = BIO_vsnprintf(buf, n, format, args); | - | ||||||||||||||||||||||||
| 1009 | - | |||||||||||||||||||||||||
| 1010 | - | |||||||||||||||||||||||||
| 1011 | __builtin_va_end( | - | ||||||||||||||||||||||||
| 1012 | args | - | ||||||||||||||||||||||||
| 1013 | ) | - | ||||||||||||||||||||||||
| 1014 | ; | - | ||||||||||||||||||||||||
| 1015 | return executed 693767 times by 1 test: ret;return ret;Executed by:
executed 693767 times by 1 test: return ret;Executed by:
| 693767 | ||||||||||||||||||||||||
| 1016 | } | - | ||||||||||||||||||||||||
| 1017 | - | |||||||||||||||||||||||||
| 1018 | int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) | - | ||||||||||||||||||||||||
| 1019 | { | - | ||||||||||||||||||||||||
| 1020 | size_t retlen; | - | ||||||||||||||||||||||||
| 1021 | int truncated; | - | ||||||||||||||||||||||||
| 1022 | - | |||||||||||||||||||||||||
| 1023 | if (!_dopr(&buf,
| 1-693766 | ||||||||||||||||||||||||
| 1024 | ((void *)0)
| 1-693766 | ||||||||||||||||||||||||
| 1025 | , &n, &retlen, &truncated, format, args)
| 1-693766 | ||||||||||||||||||||||||
| 1026 | return executed 1 time by 1 test: -1;return -1;Executed by:
executed 1 time by 1 test: return -1;Executed by:
| 1 | ||||||||||||||||||||||||
| 1027 | - | |||||||||||||||||||||||||
| 1028 | if (truncated
| 0-693766 | ||||||||||||||||||||||||
| 1029 | - | |||||||||||||||||||||||||
| 1030 | - | |||||||||||||||||||||||||
| 1031 | - | |||||||||||||||||||||||||
| 1032 | - | |||||||||||||||||||||||||
| 1033 | - | |||||||||||||||||||||||||
| 1034 | - | |||||||||||||||||||||||||
| 1035 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 1036 | else | - | ||||||||||||||||||||||||
| 1037 | return executed 693766 times by 1 test: (return (retlen <= 0x7fffffff) ? (int)retlen : -1;Executed by:
executed 693766 times by 1 test: return (retlen <= 0x7fffffff) ? (int)retlen : -1;Executed by:
| 0-693766 | ||||||||||||||||||||||||
| 1038 | } | - | ||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |