[-- Attachment #1.1: Type: text/plain, Size: 1590 bytes --]
Thanks. Can you resend this with your Signed-off-by line?
On Wed, Feb 26, 2020, 07:12 François Guerraz <kubrick@fgv6.net> wrote:
> The default type for literal numerals is int, not long it, therefore
> 1024*1024*1024*1024
> overflows and
> bytes < 1024*1024*1024*1024
> is always false.
> Therefore, GiBi is never displayed and switches to TiBi immediately.
> ---
> diff --git
> a/app/src/main/java/com/wireguard/android/fragment/TunnelDetailFragment.java
>
> b/app/src/main/java/com/wireguard/android/fragment/TunnelDetailFragment.java
> index 57e0d8e..bc0726a 100644
> ---
> a/app/src/main/java/com/wireguard/android/fragment/TunnelDetailFragment.java
> +++
> b/app/src/main/java/com/wireguard/android/fragment/TunnelDetailFragment.java
> @@ -115,7 +115,7 @@ public class TunnelDetailFragment extends BaseFragment
> {
> return
> getContext().getString(R.string.transfer_kibibytes, bytes/1024.0);
> else if (bytes < 1024*1024*1024)
> return
> getContext().getString(R.string.transfer_mibibytes,
> bytes/(1024.0*1024.0));
> - else if (bytes < 1024*1024*1024*1024)
> + else if (bytes < 1024*1024*1024*1024L)
> return
> getContext().getString(R.string.transfer_gibibytes,
> bytes/(1024.0*1024.0*1024.0));
> return getContext().getString(R.string.transfer_tibibytes,
> bytes/(1024.0*1024.0*1024.0)/1024.0);
> }
> _______________________________________________
> WireGuard mailing list
> WireGuard@lists.zx2c4.com
> https://lists.zx2c4.com/mailman/listinfo/wireguard
>
[-- Attachment #1.2: Type: text/html, Size: 2133 bytes --]
[-- Attachment #2: Type: text/plain, Size: 148 bytes --]
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard