unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* divide-by-zero during redisplay
@ 2008-05-26 10:43 Miles Bader
  2008-05-26 10:58 ` Miles Bader
  2008-05-27  1:44 ` Kenichi Handa
  0 siblings, 2 replies; 3+ messages in thread
From: Miles Bader @ 2008-05-26 10:43 UTC (permalink / raw)
  To: emacs-devel

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.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-05-27  1:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

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