Index: src/natools-smaz.adb ================================================================== --- src/natools-smaz.adb +++ src/natools-smaz.adb @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ --- Copyright (c) 2016, Natacha Porté -- +-- Copyright (c) 2016-2017, Natacha Porté -- -- -- -- Permission to use, copy, modify, and distribute this software for any -- -- purpose with or without fee is hereby granted, provided that the above -- -- copyright notice and this permission notice appear in all copies. -- -- -- @@ -111,14 +111,14 @@ Remaining := 0; end if; end if; declare - Full_Blocks : constant Ada.Streams.Stream_Element_Count - := Remaining / Verbatim1_Max_Size; + Block_Count : constant Ada.Streams.Stream_Element_Count + := (Remaining + Verbatim1_Max_Size - 1) / Verbatim1_Max_Size; begin - Overhead := Overhead + Full_Blocks; + Overhead := Overhead + Block_Count; end; return Overhead + Ada.Streams.Stream_Element_Count (Original_Size); end Verbatim_Size;