| 12532 | } |
| 12533 | |
| 12534 | static bool cli_checksum_manifest_path(char *path, size_t path_size) { |
| 12535 | int written = snprintf(path, path_size, "%s/cbm-checksum-XXXXXX", cbm_tmpdir()); |
| 12536 | if (written <= 0 || (size_t)written >= path_size) { |
| 12537 | return false; |
| 12538 | } |
| 12539 | int descriptor = cbm_mkstemp(path); |
| 12540 | if (descriptor < 0) { |
| 12541 | return false; |
| 12542 | } |
| 12543 | FILE *file = fdopen(descriptor, "wb"); |
| 12544 | if (!file) { |
| 12545 | #ifdef _WIN32 |
| 12546 | (void)_close(descriptor); |
| 12547 | #else |
| 12548 | (void)close(descriptor); |
| 12549 | #endif |
| 12550 | (void)cbm_unlink(path); |
| 12551 | return false; |
| 12552 | } |
| 12553 | return fclose(file) == 0; |
| 12554 | } |
| 12555 | |
| 12556 | TEST(cli_checksum_manifest_requires_exact_filename_and_accepts_star) { |
| 12557 | static const char lower_digest[] = |
no test coverage detected