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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.101.72.201 with SMTP id o9mr696577pgs.14.1499690513404; Mon, 10 Jul 2017 05:41:53 -0700 (PDT) X-Received: by 10.36.80.211 with SMTP id m202mr454069itb.7.1499690513351; Mon, 10 Jul 2017 05:41:53 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!2.eu.feeder.erje.net!feeder.erje.net!2.us.feeder.erje.net!weretis.net!feeder6.news.weretis.net!news.glorb.com!188no1888986itx.0!news-out.google.com!f200ni4246itc.0!nntp.google.com!188no1888983itx.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 10 Jul 2017 05:41:53 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=193.163.1.105; posting-account=Srm5lQoAAAAEMX9rv2ilEKR6FDPapmSq NNTP-Posting-Host: 193.163.1.105 References: <567a23f5-a7dc-4b3d-8c16-942a8551c02f@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <29cb4699-2faf-4da3-8ed8-f01909054b4f@googlegroups.com> Subject: Re: Convert chars_ptr to Ada String From: Mark Lorenzen Injection-Date: Mon, 10 Jul 2017 12:41:53 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:47340 Date: 2017-07-10T05:41:53-07:00 List-Id: On Monday, July 10, 2017 at 11:48:29 AM UTC+2, Dmitry A. Kazakov wrote: > On 10/07/2017 11:31, Victor Porton wrote: >=20 > > Read description of Value() carefully. It stops at first NUL. >=20 > if Ptr =3D Null_Ptr then > return ""; > else > return To_Ada (Value (Ptr, Length), False); > end if; >=20 > --=20 > Regards, > Dmitry A. Kazakov > http://www.dmitry-kazakov.de I don't think that it will work as (if I understand it correctly) the strin= g the OP tries to convert may contain NULL characters that are not to be in= terpreted as string terminators. I think the problem is, that the OP is confused about the difference betwee= n C strings and C arrays of characters and tries to use Interfaces.C.String= s to manipulate C arrays of characters thar are not be interpreted as C str= ings but as simple arrays of characters. Maybe Interfaces.C.Pointers is more appropriate? Regards, Mark L