journal: avoid undefined behaviour in float division by 0.0
Coverity says that's undefined. I'm pretty sure we always would get a nan, but let's avoid (formally) undefined behaviour since that can cause compilers to do strange things.
This commit is contained in:
@@ -667,7 +667,7 @@ int decompress_stream_lz4(int in, int out, uint64_t max_bytes) {
|
||||
|
||||
log_debug("LZ4 decompression finished (%zu -> %zu bytes, %.1f%%)",
|
||||
total_in, total_out,
|
||||
(double) total_out / total_in * 100);
|
||||
total_in > 0 ? (double) total_out / total_in * 100 : 0.0);
|
||||
cleanup:
|
||||
munmap(src, st.st_size);
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user