mirror of
https://github.com/systemd/systemd.git
synced 2025-02-04 21:47:31 +03:00
journal: fix divide-by-zero warning
Fixes CID#1430209.
This commit is contained in:
parent
8062e643e6
commit
89d36ce8f7
@ -927,11 +927,12 @@ int compress_stream_zstd(int fdf, int fdt, uint64_t max_bytes) {
|
||||
break;
|
||||
}
|
||||
|
||||
log_debug(
|
||||
"ZSTD compression finished (%" PRIu64 " -> %" PRIu64 " bytes, %.1f%%)",
|
||||
in_bytes,
|
||||
max_bytes - left,
|
||||
(double) (max_bytes - left) / in_bytes * 100);
|
||||
if (in_bytes > 0)
|
||||
log_debug("ZSTD compression finished (%" PRIu64 " -> %" PRIu64 " bytes, %.1f%%)",
|
||||
in_bytes, max_bytes - left, (double) (max_bytes - left) / in_bytes * 100);
|
||||
else
|
||||
log_debug("ZSTD compression finished (%" PRIu64 " -> %" PRIu64 " bytes)",
|
||||
in_bytes, max_bytes - left);
|
||||
|
||||
return 0;
|
||||
#else
|
||||
|
Loading…
x
Reference in New Issue
Block a user