From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16650 invoked by alias); 30 May 2009 09:10:10 -0000 Received: (qmail 16190 invoked by uid 48); 30 May 2009 09:09:55 -0000 Date: Sat, 30 May 2009 09:10:00 -0000 From: "andre dot goddard at gmail dot com" To: glibc-bugs@sources.redhat.com Message-ID: <20090530090954.10220.andre.goddard@gmail.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug manual/10220] New: Fix inverted memmove parameters in glibc manual example 'file_mbsrtowcs' X-Bugzilla-Reason: CC Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2009-05/txt/msg00145.txt.bz2 On section 6.3.5 - "A Complete Multibyte Conversion Example" the example describe an algorithm to convert an NUL-terminated multibyte character string at into an equivalent wide character string. It does: 1. read from input file to temp buffer 2. convert characters in temp buffer 3. write to output file the converted characters 4. go to step one, but first copy incomplete sequence to start of temp buffer The pass four is implemented by a memmove(), taking an incomplete at the end of the buffer and repositioning it at the start of the buffer. ERROR: ------ The aforementioned memmove() has its parameters inverted, because it`s not putting the remaining characters in the beginning of the buffer. Instead of: memmove (inp, buffer, filled); It should obviously be: memmove (buffer, inp, filled); -- Summary: Fix inverted memmove parameters in glibc manual example 'file_mbsrtowcs' Product: glibc Version: 2.11 Status: NEW Severity: normal Priority: P2 Component: manual AssignedTo: roland at gnu dot org ReportedBy: andre dot goddard at gmail dot com CC: glibc-bugs at sources dot redhat dot com http://sourceware.org/bugzilla/show_bug.cgi?id=10220 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.