unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
To: Miles Bader <miles@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: divide-by-zero during redisplay
Date: Tue, 27 May 2008 10:44:58 +0900	[thread overview]
Message-ID: <E1K0oFG-0002bc-6n@etlken.m17n.org> (raw)
In-Reply-To: <buotzgl4a7a.fsf@dhapc248.dev.necel.com> (message from Miles Bader on Mon, 26 May 2008 19:43:37 +0900)

In article <buotzgl4a7a.fsf@dhapc248.dev.necel.com>, Miles Bader <miles.bader@necel.com> writes:

> In the function "xfont_open", there's this code (line 611):
> 	  int width = font->space_width, n = pcm != NULL;

> 	  for (char2b.byte2 = 33; char2b.byte2 <= 126; char2b.byte2++)
> 	    if ((pcm = xfont_get_pcm (xfont, &char2b)) != NULL)
> 	      width += pcm->width, n++;
> 	  font->average_width = width / n;

> I'm getting divide-by-zeros during redisplay, because n == 0.

> Maybe this represents some degenerate condition (I'm having a hard time
> reproducing it currently; I saw it happen while displaying rcirc channel
> buffers), but still, it seems the code should avoid dividing by zero in
> such a case.

Right.  I've just installed a fix.

---
Kenichi Handa
handa@ni.aist.go.jp




      parent reply	other threads:[~2008-05-27  1:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-26 10:43 divide-by-zero during redisplay Miles Bader
2008-05-26 10:58 ` Miles Bader
2008-05-27  1:44 ` Kenichi Handa [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=E1K0oFG-0002bc-6n@etlken.m17n.org \
    --to=handa@m17n.org \
    --cc=emacs-devel@gnu.org \
    --cc=miles@gnu.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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