emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: divide-by-zero during redisplay


From: Kenichi Handa
Subject: Re: divide-by-zero during redisplay
Date: Tue, 27 May 2008 10:44:58 +0900
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

In article <address@hidden>, Miles Bader <address@hidden> 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
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]