load file into buffer that already has the correct allocated size. Returns error code.*/
| 371 | |
| 372 | /* load file into buffer that already has the correct allocated size. Returns error code.*/ |
| 373 | static unsigned lodepng_buffer_file(unsigned char* out, size_t size, const char* filename) |
| 374 | { |
| 375 | FILE* file; |
| 376 | size_t readsize; |
| 377 | file = fopen(filename, "rb"); |
| 378 | if(!file) return 78; |
| 379 | |
| 380 | readsize = fread(out, 1, size, file); |
| 381 | fclose(file); |
| 382 | |
| 383 | if (readsize != size) return 78; |
| 384 | return 0; |
| 385 | } |
| 386 | |
| 387 | unsigned lodepng_load_file(unsigned char** out, size_t* outsize, const char* filename) |
| 388 | { |
no outgoing calls
no test coverage detected