From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,23d2475711dc99b8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-03-11 06:29:39 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.wirehub.nl!news.tele.dk!news.tele.dk!small.news.tele.dk!news-stoc.telia.net!news-stoa.telia.net!telia.net!masternews.telia.net.!newsc.telia.net.POSTED!not-for-mail From: =?ISO-8859-1?Q?Bj=F6rn_Persson?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031114 X-Accept-Language: sv, en-us MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: A bug in Gnat, or in my code? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Message-ID: Date: Thu, 11 Mar 2004 14:29:37 GMT NNTP-Posting-Host: 217.209.116.179 X-Complaints-To: abuse@telia.com X-Trace: newsc.telia.net 1079015377 217.209.116.179 (Thu, 11 Mar 2004 15:29:37 CET) NNTP-Posting-Date: Thu, 11 Mar 2004 15:29:37 CET Organization: Telia Internet Xref: archiver1.google.com comp.lang.ada:6237 Date: 2004-03-11T14:29:37+00:00 List-Id: Preben Randhol wrote: > That said what are you trying to do with the code? It looks wierd > to me. Of course that code is useless. That's just a stripped test case. The=20 bug occurs in To_Unbounded_String, called from this procedure: procedure klyv(argument : in string; namn : out unbounded_string; text : out unbounded_string) is use Ada.Strings; use ada.strings.fixed; pos : natural; begin pos :=3D index(argument, "=3D"); if pos =3D 0 then pos :=3D argument'last + 1; end if; namn :=3D to_unbounded_string( trim(argument(argument'first .. pos - 1), both)); text :=3D to_unbounded_string( argument(pos + 1 .. argument'last)); end klyv; It splits a string of the format "name=3Dvalue" into two. If there is no = equal sign, the whole string goes into Namn, and Text should become an=20 empty string. In that case To_Unbounded_String is called with=20 Argument(Argument'Last+2..Argument'Last), which triggers the bug. --=20 Bj=F6rn Persson jor ers @sv ge. b n_p son eri nu