[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [manual] Example update needed for printf(3)
From: |
Andreas Jaeger |
Subject: |
Re: [manual] Example update needed for printf(3) |
Date: |
23 Feb 2001 19:23:18 +0100 |
User-agent: |
Gnus/5.090001 (Oort Gnus v0.01) XEmacs/21.1 (Channel Islands) |
iq-0 <address@hidden> writes:
> Hello,
>
> There is a nice example at the bottom of the printf(3) manual
> page. There are 2 things remarks I would like to make, one which
> should probably be changed, the other pherhaps not (but I think so).
glibc doesn't come with manual pages, we use the info documentation.
I've CC'ed Andries who maintains the manual pages.
Andreas
>
> 1) At the bottom, when a realloc fails, it doesn't free the original
> pointer. In my personal copy of this function i also have a char *q,
> which is used as a intermediate around the realloc for the case it
> fails:
>
> if ((q = realloc (p, size)) == NULL)
> { /* If realloc fails p remains unchanged, according to
> doc, let's check and free() */
>
> if (p != NULL)
> free (p);
> return NULL;
> } else
> p = q;
>
> 2) In case of glibc version 2.0 resize statement, it would be nice if
> it were something like += 100 instead of*=2 I think most people who
> really would use it to concat a long string would not want that the
> double amount of space would be used!!
>
>
> I know this is just an example, but is fairly nice, and I think people
> actually use it.
>
>
> Regards,
>
> justin....
>
>
> _______________________________________________
> Bug-glibc mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-glibc
>
--
Andreas Jaeger
SuSE Labs address@hidden
private address@hidden
http://www.suse.de/~aj