MCPcopy Create free account
hub / github.com/creatale/node-dv / lodepng_buffer_file

Function lodepng_buffer_file

deps/lodepng/lodepng.cpp:381–393  ·  view source on GitHub ↗

load file into buffer that already has the correct allocated size. Returns error code.*/

Source from the content-addressed store, hash-verified

379
380/* load file into buffer that already has the correct allocated size. Returns error code.*/
381static unsigned lodepng_buffer_file(unsigned char* out, size_t size, const char* filename)
382{
383 FILE* file;
384 size_t readsize;
385 file = fopen(filename, "rb");
386 if(!file) return 78;
387
388 readsize = fread(out, 1, size, file);
389 fclose(file);
390
391 if (readsize != size) return 78;
392 return 0;
393}
394
395unsigned lodepng_load_file(unsigned char** out, size_t* outsize, const char* filename)
396{

Callers 2

lodepng_load_fileFunction · 0.85
load_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected