| 138 | } |
| 139 | |
| 140 | bool gi_zero(gi_guard_t *guard, void *storage, size_t bytes) { |
| 141 | unsigned char *output = storage; |
| 142 | enum { ZERO_CHUNK = 256 }; |
| 143 | while (bytes) { |
| 144 | size_t chunk = bytes < ZERO_CHUNK ? bytes : ZERO_CHUNK; |
| 145 | if (!gi_work(guard, chunk)) { |
| 146 | return false; |
| 147 | } |
| 148 | memset(output, 0, chunk); |
| 149 | output += chunk; |
| 150 | bytes -= chunk; |
| 151 | } |
| 152 | return true; |
| 153 | } |
| 154 | |
| 155 | static bool gi_trim(const char *line, size_t *length, gi_guard_t *guard) { |
| 156 | while (*length) { |
no test coverage detected