Skip to content

Commit

Permalink
fix compiler warnings about const-breaking cast
Browse files Browse the repository at this point in the history
`buffer` is already declared as `const unsigned char*`, which can be
transparently accepted by `fwrite()`. Casting it to `char*` here just
makes compilers complain about "discarding cv-qualifiers", so this
commit removes that cast.
  • Loading branch information
Jesin committed Oct 22, 2018
1 parent 071e37c commit 2f132d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lodepng.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ unsigned lodepng_save_file(const unsigned char* buffer, size_t buffersize, const
FILE* file;
file = fopen(filename, "wb" );
if(!file) return 79;
fwrite((char*)buffer , 1 , buffersize, file);
fwrite(buffer, 1, buffersize, file);
fclose(file);
return 0;
}
Expand Down

0 comments on commit 2f132d4

Please sign in to comment.