1 2 3 4 5 6 7 8 9 10 11 | // UNTESTED -- This is intended to test if a file contains the expected contents.
// Okay to copy/adapt if you undersand it. You are responsible for making sure it is correct.
void _write_to_file(char const* path, uint8_t* contents, size_t num_bytes) {
FILE* fp = fopen(path, "w");
for(int i = 0; i < num_bytes; i++) {
fputc(contents[i], fp);
}
fclose(fp);
}
|
© Copyright 2023 Alexander J. Quinn This content is protected and may not be shared, uploaded, or distributed.