| 110 | } while (0) |
| 111 | |
| 112 | static int parseInt(const char *&ptr) { |
| 113 | int val = 0; |
| 114 | while (*ptr >= '0' && *ptr <= '9') { |
| 115 | val = val * 10 + (*ptr - '0'); |
| 116 | if (val > 1000) { |
| 117 | return -1; |
| 118 | } |
| 119 | ++ptr; |
| 120 | } |
| 121 | return val; |
| 122 | } |
| 123 | |
| 124 | // This function is a limited version of fprintf(f, formatString, val) where |
| 125 | // formatString is a subset of formatting strings accepted by |
no outgoing calls
no test coverage detected