| 48 | return n > 0 && (size_t)n < cap; |
| 49 | } |
| 50 | static bool pc_write(const char *path, const char *text) { |
| 51 | FILE *f = cbm_fopen(path, "wb"); |
| 52 | if (!f) return false; |
| 53 | size_t size = strlen(text); |
| 54 | bool ok = fwrite(text, 1, size, f) == size; |
| 55 | return fclose(f) == 0 && ok; |
| 56 | } |
| 57 | static bool pc_source_write(pc_fixture_t *f, const char *leaf, const char *text) { |
| 58 | char path[1024]; |
| 59 | return pc_path(path, sizeof(path), f->repo, leaf) && pc_write(path, text); |
no test coverage detected