tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: tech@mdocml.bsd.lv
Subject: Re: Remaining patches
Date: Sat, 11 Dec 2010 18:07:14 +0100	[thread overview]
Message-ID: <20101211170714.GG27691@iris.usta.de> (raw)
In-Reply-To: <20101211170236.GF27691@iris.usta.de>

> Index: main.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/mandoc/main.c,v
> retrieving revision 1.61
> diff -u -p -r1.61 main.c
> --- main.c	9 Dec 2010 23:01:18 -0000	1.61
> +++ main.c	11 Dec 2010 17:01:40 -0000
> @@ -375,7 +375,7 @@ static void
>  resize_buf(struct buf *buf, size_t initial)
>  {
>  
> -	buf->sz = buf->sz ? 2 * buf->sz : initial;
> +	buf->sz = buf->sz >= initial ? 2 * buf->sz : initial;
>  	buf->buf = realloc(buf->buf, buf->sz);
>  	if (NULL == buf->buf) {
>  		perror(NULL);

Gah, that's wrong as well.
It only moves the bug from sz = 1 to sz = initial-1.

It must be

  buf->sz = buf->sz > initial/2 ? 2 * buf->sz : initial;
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

  reply	other threads:[~2010-12-11 17:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4CF65D82.2090302@bsd.lv>
     [not found] ` <20101201145258.GA18473@iris.usta.de>
     [not found]   ` <4CF662C5.8070806@bsd.lv>
     [not found]     ` <20101202200205.GA12188@iris.usta.de>
     [not found]       ` <4CF82337.2060203@bsd.lv>
     [not found]         ` <20101202232111.GE12188@iris.usta.de>
     [not found]           ` <4CFCE8A6.7000101@bsd.lv>
     [not found]             ` <4CFCE997.6000700@bsd.lv>
     [not found]               ` <20101206142051.GA6999@iris.usta.de>
     [not found]                 ` <4CFD0AE3.8050502@bsd.lv>
2010-12-11 17:02                   ` Ingo Schwarze
2010-12-11 17:07                     ` Ingo Schwarze [this message]
2010-12-19 12:41                       ` Ingo Schwarze
2010-12-20 14:50                         ` Kristaps Dzonsons
2010-12-21  2:00                           ` Ingo Schwarze

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101211170714.GG27691@iris.usta.de \
    --to=schwarze@usta.de \
    --cc=tech@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).