Natools

Check-in [ebba07e9a7]
Login
Overview
Comment:smaz_implementations-base_64: fix index update in encoding 3n+2 vrbtim
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ebba07e9a760c6da6e730897308d42c1154c686c
User & Date: nat on 2016-12-29 21:47:01
Other Links: manifest | tags
Context
2016-12-30
22:11
smaz_generic-tools: fix removal of the first item of a dictionary check-in: dd10a5bea1 user: nat tags: trunk
2016-12-29
21:47
smaz_implementations-base_64: fix index update in encoding 3n+2 vrbtim check-in: ebba07e9a7 user: nat tags: trunk
2016-12-28
22:29
smaz_implementations-base_64: fix reading of 3n+2 verbatim length

A sign error caused a direct constraint error, and using the wrong type caused overlong reads (now 4 is hardcoded just like it is in encoding code). check-in: 23d16059bd user: nat tags: trunk

Changes

Modified src/natools-smaz_implementations-base_64.adb from [79f9fdb2bc] to [106572d0cd].

238
239
240
241
242
243
244
245

246
247
248
249
250
251
252
238
239
240
241
242
243
244

245
246
247
248
249
250
251
252







-
+







                 := Tools.Image (61 - Tools.Base_64_Digit (Extra_Blocks / 4));
               Offset := Offset + 1;

               Tools.Encode_Double
                 (Input (Index .. Index + 1),
                  Tools.Double_Byte_Padding (Extra_Blocks mod 4),
                  Output, Offset);
               Index := Index + 1;
               Index := Index + 2;

               if Extra_Blocks > 0 then
                  Tools.Encode
                    (Input (Index .. Index + Extra_Blocks * 3 - 1),
                     Output, Offset);
                  Index := Index + Extra_Blocks * 3;
               end if;