public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug manual/266] New: l64a encoding example in manual incorrect
@ 2004-07-14  1:18 julian dot graham at aya dot yale dot edu
  2004-07-15 12:00 ` [Bug manual/266] " jakub at redhat dot com
  2004-07-15 21:02 ` roland at gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: julian dot graham at aya dot yale dot edu @ 2004-07-14  1:18 UTC (permalink / raw)
  To: glibc-bugs

The encode() function that's provided in the glibc manual for converting a
string of characters to pseudo-base64 encoding is very helpful, but it's not
quite correct.  It assumes that l64a will always return a string of length 6,
when in fact l64a can return shorter strings on perfectly valid inputs.  As it
stands, if you use the function as printed on arbitrary data, you may get back a
surprisingly short string, since one of the mempcpys can insert a terminating
null when it tries to copy a shorter-than-6 string from l64a.  The fix would be
to replace each call to l64a and mempcpy with something like:

char *foo = l64a(htonl(input));
int foo_len = strlen(foo);
cp = mempcpy(cp, foo, foo_len);
cp = mempcpy(cp, "......", 6 - foo_len);

...since padding with dots plays nicely with the encoding.

Let me know if you'd like me to provide a full re-write.

-- 
           Summary: l64a encoding example in manual incorrect
           Product: glibc
           Version: 2.3.3
            Status: NEW
          Severity: minor
          Priority: P2
         Component: manual
        AssignedTo: roland at gnu dot org
        ReportedBy: julian dot graham at aya dot yale dot edu
                CC: glibc-bugs at sources dot redhat dot com


http://sources.redhat.com/bugzilla/show_bug.cgi?id=266

------- 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] 3+ messages in thread

* [Bug manual/266] l64a encoding example in manual incorrect
  2004-07-14  1:18 [Bug manual/266] New: l64a encoding example in manual incorrect julian dot graham at aya dot yale dot edu
@ 2004-07-15 12:00 ` jakub at redhat dot com
  2004-07-15 21:02 ` roland at gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: jakub at redhat dot com @ 2004-07-15 12:00 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From jakub at redhat dot com  2004-07-15 12:00 -------
Fixed in CVS.
Roland, why the commit did not show up here?  The commit message did not
contain [BZ #266], but the ChangeLog did, should I put the [BZ #266] string
at the end of the file change msg instead of on top of the ChangeLog entry?

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


http://sources.redhat.com/bugzilla/show_bug.cgi?id=266

------- 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] 3+ messages in thread

* [Bug manual/266] l64a encoding example in manual incorrect
  2004-07-14  1:18 [Bug manual/266] New: l64a encoding example in manual incorrect julian dot graham at aya dot yale dot edu
  2004-07-15 12:00 ` [Bug manual/266] " jakub at redhat dot com
@ 2004-07-15 21:02 ` roland at gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: roland at gnu dot org @ 2004-07-15 21:02 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From roland at gnu dot org  2004-07-15 21:02 -------
Yes, the script only sees the CVS commit log message text, not the ChangeLog
contents.  It's the same thing that sends email to glibc-cvs@sources.redhat.com,
and basically has to work with only the text you see in those messages.

Ideally every file's commit message should be exactly the ChangeLog paragraph
plus its header line covering the topically-related change, even when that
paragraph includes multiple files' changes.  That's how I do them.

-- 


http://sources.redhat.com/bugzilla/show_bug.cgi?id=266

------- 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] 3+ messages in thread

end of thread, other threads:[~2004-07-15 21:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-14  1:18 [Bug manual/266] New: l64a encoding example in manual incorrect julian dot graham at aya dot yale dot edu
2004-07-15 12:00 ` [Bug manual/266] " jakub at redhat dot com
2004-07-15 21:02 ` roland at gnu dot org

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).