MCPcopy Create free account
hub / github.com/DFHack/dfhack / lodepng_save_file

Function lodepng_save_file

depends/lodepng/lodepng.cpp:390–397  ·  view source on GitHub ↗

write given buffer to the file, overwriting the file, it doesn't append to it.*/

Source from the content-addressed store, hash-verified

388
389/*write given buffer to the file, overwriting the file, it doesn't append to it.*/
390unsigned lodepng_save_file(const unsigned char* buffer, size_t buffersize, const char* filename) {
391 FILE* file;
392 file = fopen(filename, "wb" );
393 if(!file) return 79;
394 fwrite(buffer, 1, buffersize, file);
395 fclose(file);
396 return 0;
397}
398
399#endif /*LODEPNG_COMPILE_DISK*/
400

Callers 2

lodepng_encode_fileFunction · 0.85
save_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected