From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: divide-by-zero during redisplay Date: Mon, 26 May 2008 19:43:37 +0900 Message-ID: Reply-To: Miles Bader NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1211800001 4931 80.91.229.12 (26 May 2008 11:06:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 26 May 2008 11:06:41 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 26 13:07:21 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 1K0aXv-00049I-JR for ged-emacs-devel@m.gmane.org; Mon, 26 May 2008 13:07:19 +0200 Original-Received: from localhost ([127.0.0.1]:42315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K0aXA-0000EG-Lf for ged-emacs-devel@m.gmane.org; Mon, 26 May 2008 07:06:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K0aB8-0008Oh-HT for emacs-devel@gnu.org; Mon, 26 May 2008 06:43:46 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K0aB6-0008Nm-PO for emacs-devel@gnu.org; Mon, 26 May 2008 06:43:46 -0400 Original-Received: from [199.232.76.173] (port=44358 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K0aB6-0008Ni-JX for emacs-devel@gnu.org; Mon, 26 May 2008 06:43:44 -0400 Original-Received: from tyo201.gate.nec.co.jp ([202.32.8.193]:55532) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K0aB3-0004wG-63; Mon, 26 May 2008 06:43:41 -0400 Original-Received: from relay31.aps.necel.com ([10.29.19.54]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m4QAhP0s019437; Mon, 26 May 2008 19:43:38 +0900 (JST) Original-Received: from relay21.aps.necel.com ([10.29.19.20] [10.29.19.20]) by relay31.aps.necel.com with ESMTP; Mon, 26 May 2008 19:43:38 +0900 Original-Received: from dhapc248.dev.necel.com ([10.114.112.215] [10.114.112.215]) by relay21.aps.necel.com with ESMTP; Mon, 26 May 2008 19:43:38 +0900 Original-Received: by dhapc248.dev.necel.com (Postfix, from userid 31295) id 3DDB05CB; Mon, 26 May 2008 19:43:38 +0900 (JST) System-Type: i686-pc-linux-gnu Blat: Foop Original-Lines: 23 X-detected-kernel: by monty-python.gnu.org: Solaris 8 (1) 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:97714 Archived-At: 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. Thanks, -Miles -- Mayonnaise, n. One of the sauces that serve the French in place of a state religion.