This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix example in charset.texi


On Tue, Jul 22, 2003 at 04:37:53PM +0200, Jakub Jelinek wrote:
> On Tue, Jul 22, 2003 at 09:33:17AM -0500, Art Haas wrote:
> > Hi.
> > 
> > The example function returns the wrong variable. 'wcp' is the pointer
> > from malloc(), 'result' points at the end of the string.
> 
> I think it would be better to s/\*result++/*wcp++/ instead, so that
> result describes the result.
> 

OK.

2003-07-21  Art Haas  <ahaas@airmail.net>

	* charset.texi: Fix example code so a valid pointer is returned.

Index: manual/charset.texi
===================================================================
RCS file: /cvs/glibc/libc/manual/charset.texi,v
retrieving revision 1.37
diff -u -u -r1.37 charset.texi
--- manual/charset.texi	30 Jun 2002 03:35:20 -0000	1.37
+++ manual/charset.texi	22 Jul 2003 14:46:50 -0000
@@ -696,7 +696,7 @@
       if (nbytes >= (size_t) -2)
         /* Invalid input string.  */
         return NULL;
-      *result++ = towupper (tmp[0]);
+      *wcp++ = towupper (tmp[0]);
       len -= nbytes;
       s += nbytes;
     @}
-- 
Man once surrendering his reason, has no remaining guard against absurdities
the most monstrous, and like a ship without rudder, is the sport of every wind.

-Thomas Jefferson to James Smith, 1822


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]