| 534 | } |
| 535 | |
| 536 | static bool pt_oid(pt_fixture *fx, const char *const *argv, char out[65]) { |
| 537 | char bytes[80]; |
| 538 | if (!pt_git(fx, argv, bytes, sizeof(bytes))) |
| 539 | return false; |
| 540 | size_t n = strlen(bytes); |
| 541 | if (n && bytes[n - 1] == '\n') |
| 542 | bytes[--n] = 0; |
| 543 | if (n && bytes[n - 1] == '\r') |
| 544 | bytes[--n] = 0; |
| 545 | if (n != fx->width) |
| 546 | return false; |
| 547 | for (size_t i = 0; i < n; i++) |
| 548 | if (!((bytes[i] >= '0' && bytes[i] <= '9') || (bytes[i] >= 'a' && bytes[i] <= 'f'))) |
| 549 | return false; |
| 550 | memcpy(out, bytes, n + 1); |
| 551 | return true; |
| 552 | } |
| 553 | |
| 554 | static bool pt_object(pt_fixture *fx, const char *type, const void *bytes, size_t length, |
| 555 | char out[65]) { |
no test coverage detected