| 163 | } |
| 164 | |
| 165 | static bool gf_oid(gf_fixture_t *fx, const char *const *argv, char out[65]) { |
| 166 | char text[80]; |
| 167 | if (!gf_git(fx, argv, text, sizeof(text))) |
| 168 | return false; |
| 169 | size_t n = strlen(text); |
| 170 | if (n && text[n - 1] == '\n') |
| 171 | text[--n] = '\0'; |
| 172 | if (n && text[n - 1] == '\r') |
| 173 | text[--n] = '\0'; |
| 174 | if (n != fx->oid_length) |
| 175 | return false; |
| 176 | for (size_t i = 0; i < n; i++) { |
| 177 | if (!((text[i] >= '0' && text[i] <= '9') || (text[i] >= 'a' && text[i] <= 'f'))) |
| 178 | return false; |
| 179 | } |
| 180 | memcpy(out, text, n + 1); |
| 181 | return true; |
| 182 | } |
| 183 | |
| 184 | static bool gf_object(gf_fixture_t *fx, const char *type, const void *bytes, size_t length, |
| 185 | char out[65]) { |
no test coverage detected