| 12313 | } |
| 12314 | |
| 12315 | static bool cli_checksum_manifest_path(char *path, size_t path_size) { |
| 12316 | int written = snprintf(path, path_size, "%s/cbm-checksum-XXXXXX", cbm_tmpdir()); |
| 12317 | if (written <= 0 || (size_t)written >= path_size) { |
| 12318 | return false; |
| 12319 | } |
| 12320 | int descriptor = cbm_mkstemp(path); |
| 12321 | if (descriptor < 0) { |
| 12322 | return false; |
| 12323 | } |
| 12324 | FILE *file = fdopen(descriptor, "wb"); |
| 12325 | if (!file) { |
| 12326 | #ifdef _WIN32 |
| 12327 | (void)_close(descriptor); |
| 12328 | #else |
| 12329 | (void)close(descriptor); |
| 12330 | #endif |
| 12331 | (void)cbm_unlink(path); |
| 12332 | return false; |
| 12333 | } |
| 12334 | return fclose(file) == 0; |
| 12335 | } |
| 12336 | |
| 12337 | TEST(cli_checksum_manifest_requires_exact_filename_and_accepts_star) { |
| 12338 | static const char lower_digest[] = |
no test coverage detected