From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: divide-by-zero during redisplay Date: Tue, 27 May 2008 10:44:58 +0900 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1211852726 8193 80.91.229.12 (27 May 2008 01:45:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 27 May 2008 01:45:26 +0000 (UTC) Cc: emacs-devel@gnu.org To: Miles Bader Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 27 03:46:06 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K0oGI-0006ja-B0 for ged-emacs-devel@m.gmane.org; Tue, 27 May 2008 03:46:02 +0200 Original-Received: from localhost ([127.0.0.1]:60324 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K0oFX-0002SO-8v for ged-emacs-devel@m.gmane.org; Mon, 26 May 2008 21:45:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K0oFP-0002Q6-TF for emacs-devel@gnu.org; Mon, 26 May 2008 21:45:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K0oFO-0002Pe-E0 for emacs-devel@gnu.org; Mon, 26 May 2008 21:45:07 -0400 Original-Received: from [199.232.76.173] (port=54586 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K0oFO-0002Pb-8N for emacs-devel@gnu.org; Mon, 26 May 2008 21:45:06 -0400 Original-Received: from mx1.aist.go.jp ([150.29.246.133]:42628) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K0oFJ-00033w-UO; Mon, 26 May 2008 21:45:02 -0400 Original-Received: from rqsmtp1.aist.go.jp (rqsmtp1.aist.go.jp [150.29.254.115]) by mx1.aist.go.jp with ESMTP id m4R1j6GD028122; Tue, 27 May 2008 10:45:06 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp3.aist.go.jp by rqsmtp1.aist.go.jp with ESMTP id m4R1ix7l021111; Tue, 27 May 2008 10:44:59 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp3.aist.go.jp with ESMTP id m4R1iwoY021878; Tue, 27 May 2008 10:44:58 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken.m17n.org with local (Exim 4.69) (envelope-from ) id 1K0oFG-0002bc-6n; Tue, 27 May 2008 10:44:58 +0900 In-reply-to: (message from Miles Bader on Mon, 26 May 2008 19:43:37 +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) X-detected-kernel: by monty-python.gnu.org: Solaris 9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:97769 Archived-At: In article , Miles Bader 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