public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug manual/10220] New: Fix inverted memmove parameters in glibc manual example 'file_mbsrtowcs'
@ 2009-05-30  9:10 andre dot goddard at gmail dot com
  2009-05-30  9:14 ` [Bug manual/10220] " andre dot goddard at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: andre dot goddard at gmail dot com @ 2009-05-30  9:10 UTC (permalink / raw)
  To: glibc-bugs

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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug manual/10220] Fix inverted memmove parameters in glibc manual example 'file_mbsrtowcs'
  2009-05-30  9:10 [Bug manual/10220] New: Fix inverted memmove parameters in glibc manual example 'file_mbsrtowcs' andre dot goddard at gmail dot com
@ 2009-05-30  9:14 ` andre dot goddard at gmail dot com
  2009-06-02 14:36 ` andre dot goddard at gmail dot com
  2009-06-02 14:39 ` andre dot goddard at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: andre dot goddard at gmail dot com @ 2009-05-30  9:14 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From andre dot goddard at gmail dot com  2009-05-30 09:14 -------
Created an attachment (id=3976)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=3976&action=view)
proposed patch

proposed fix

-- 


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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug manual/10220] Fix inverted memmove parameters in glibc manual example 'file_mbsrtowcs'
  2009-05-30  9:10 [Bug manual/10220] New: Fix inverted memmove parameters in glibc manual example 'file_mbsrtowcs' andre dot goddard at gmail dot com
  2009-05-30  9:14 ` [Bug manual/10220] " andre dot goddard at gmail dot com
@ 2009-06-02 14:36 ` andre dot goddard at gmail dot com
  2009-06-02 14:39 ` andre dot goddard at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: andre dot goddard at gmail dot com @ 2009-06-02 14:36 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From andre dot goddard at gmail dot com  2009-06-02 14:36 -------
Commited on: http://repo.or.cz/w/glibc.git?
a=commit;h=21e66bc528edcbe18d434eb33a601e0f796904c9

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug manual/10220] Fix inverted memmove parameters in glibc manual example 'file_mbsrtowcs'
  2009-05-30  9:10 [Bug manual/10220] New: Fix inverted memmove parameters in glibc manual example 'file_mbsrtowcs' andre dot goddard at gmail dot com
  2009-05-30  9:14 ` [Bug manual/10220] " andre dot goddard at gmail dot com
  2009-06-02 14:36 ` andre dot goddard at gmail dot com
@ 2009-06-02 14:39 ` andre dot goddard at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: andre dot goddard at gmail dot com @ 2009-06-02 14:39 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From andre dot goddard at gmail dot com  2009-06-02 14:38 -------
Fix is available from latest sources now.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |VERIFIED


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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-06-02 14:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-30  9:10 [Bug manual/10220] New: Fix inverted memmove parameters in glibc manual example 'file_mbsrtowcs' andre dot goddard at gmail dot com
2009-05-30  9:14 ` [Bug manual/10220] " andre dot goddard at gmail dot com
2009-06-02 14:36 ` andre dot goddard at gmail dot com
2009-06-02 14:39 ` andre dot goddard at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).