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-Thread: a07f3367d7,c9d5fc258548b22a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!news.tornevall.net!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: How do I write directly to a memory address? Date: Thu, 03 Feb 2011 11:24:25 -0700 Organization: TornevallNET - http://news.tornevall.net Message-ID: References: <67063a5b-f588-45ea-bf22-ca4ba0196ee6@l11g2000yqb.googlegroups.com> <31c357bd-c8dc-4583-a454-86d9c579e5f4@m13g2000yqb.googlegroups.com> NNTP-Posting-Host: 421efd64558ccb3b861032777e2e18da Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: bee0e880dd6d5cc30724ec6f5913addd X-Complaints-To: abuse@tornevall.net User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 X-Complaints-Language: Spoken language is english or swedish - NOT ITALIAN, FRENCH, GERMAN OR ANY OTHER LANGUAGE! In-Reply-To: <31c357bd-c8dc-4583-a454-86d9c579e5f4@m13g2000yqb.googlegroups.com> X-UserIDNumber: 1738 X-Validate-Post: http://news.tornevall.net/validate.php?trace=bee0e880dd6d5cc30724ec6f5913addd X-Complaints-Italiano: Non abbiamo padronanza della lingua italiana - se mandate una email scrivete solo in Inglese, grazie X-Posting-User: 0243687135df8c4b260dd4a9a93c79bd Xref: g2news2.google.com comp.lang.ada:17824 Date: 2011-02-03T11:24:25-07:00 List-Id: On 02/03/2011 01:24 AM, Ludovic Brenta wrote: > > *Every* time I look at C code, I see a bug. > I think this is a bug; it should read "message++" since you want to > increment the pointer, not the pointed-to character. As others have explained, this is not an error, though the unused dereference is wasted effort. However, if message does not contain zero, this will happily read memory outside of message, and if the first zero encountered follows enough bytes, it will happily write memory outside of vidmem. -- Jeff Carter "How'd you like to hide the egg and gurgitate a few saucers of mocha java?" Never Give a Sucker an Even Break 101