GNU bug report logs - #5710
23.1; Fatal error in format

Previous Next

Package: emacs;

Reported by: Andreas Politz <politza <at> fh-trier.de>

Date: Fri, 12 Mar 2010 14:24:01 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Andreas Politz <politza <at> fh-trier.de>, Stefan Monnier  <monnier <at> iro.umontreal.ca>
Cc: 5710 <at> debbugs.gnu.org
Subject: bug#5710: 23.1; Fatal error in format
Date: Sat, 13 Mar 2010 14:57:18 -0500
> (format "%16.s" "0123456789abcdef")
>
> makes emacs abort.  This reflects the following situation in editfns.c :
>
> total = 5 + 5 + 1 = 11
> field_width = 16
> precision = 0
> thissize = 0
> actual_width = 16
>
> thissize += max(0,16 - 16) = 0
> total += 0 + 4 = 15
>
> I think it is clearly a mistake to substract the width of the
> whole argument-string from the field_width, regardless of how
> much of it will actually end up in the result, depending
> on the precision mod.

Thanks.  I agree with your analysis, and have checked your patch into
the trunk.

Stefan, I think it's worthwhile to include this patch in the release
branch as well, though it's not a regression (it appears to be a
longstanding bug).  Aborts in `format' are not good.  What's your
opinion?




This bug report was last modified 15 years and 71 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.