| 67 | return n > 0 && (size_t)n < size; |
| 68 | } |
| 69 | static bool pf_write(const char *path, const char *text) { |
| 70 | FILE *file = cbm_fopen(path, "wb"); |
| 71 | if (!file) |
| 72 | return false; |
| 73 | size_t len = strlen(text); |
| 74 | bool ok = fwrite(text, 1, len, file) == len; |
| 75 | return fclose(file) == 0 && ok; |
| 76 | } |
| 77 | static bool pf_source_write(pf_fixture_t *f, const char *leaf, const char *text) { |
| 78 | char path[1024]; |
| 79 | return pf_path(path, sizeof(path), f->source, leaf) && pf_write(path, text); |
no test coverage detected