Sign in
◑
Theme
gdch-oss
/
third_party
/
refs/heads/mirror/github.com/Cisco-Talos/clamav/CLAM-2991-preclass-bytecode-verdict-1.5.2-plus-patch
/
.
/
libclamunrar
/
smallfn.cpp
blob: 81259d02f302215e3b7c4124436ddb712fd48748 [
file
] [
edit
]
#include
"rar.hpp"
int
ToPercent
(
int64
N1
,
int64
N2
)
{
if
(
N2
<
N1
)
return
100
;
return
ToPercentUnlim
(
N1
,
N2
);
}
// Allows the percent larger than 100.
int
ToPercentUnlim
(
int64
N1
,
int64
N2
)
{
if
(
N2
==
0
)
return
0
;
return
(
int
)(
N1
*
100
/
N2
);
}