From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#5710: 23.1; Fatal error in format Date: Sat, 13 Mar 2010 14:57:18 -0500 Message-ID: <87aaucgfkx.fsf@stupidchicken.com> References: <87vdd1ekt7.fsf@fh-trier.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1268511965 2989 80.91.229.12 (13 Mar 2010 20:26:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 13 Mar 2010 20:26:05 +0000 (UTC) Cc: 5710@debbugs.gnu.org To: Andreas Politz , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 13 21:25:55 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NqXuC-0005m7-HH for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Mar 2010 21:25:52 +0100 Original-Received: from localhost ([127.0.0.1]:38110 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NqXuB-0006ZS-Qm for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Mar 2010 15:25:51 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NqXt7-0006Hf-NI for bug-gnu-emacs@gnu.org; Sat, 13 Mar 2010 15:24:45 -0500 Original-Received: from [140.186.70.92] (port=38206 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NqXt4-0006Gg-RE for bug-gnu-emacs@gnu.org; Sat, 13 Mar 2010 15:24:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NqXt1-0001lk-Ig for bug-gnu-emacs@gnu.org; Sat, 13 Mar 2010 15:24:42 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34742) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NqXt1-0001lg-FV for bug-gnu-emacs@gnu.org; Sat, 13 Mar 2010 15:24:39 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NqXTG-0002EQ-99; Sat, 13 Mar 2010 14:58:02 -0500 X-Loop: bug-gnu-emacs@gnu.org In-Reply-To: <87vdd1ekt7.fsf@fh-trier.de> Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Mar 2010 19:58:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-GNU-PR-Message: followup 5710 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 5710-submit@debbugs.gnu.org id=B5710.12685102458557 (code B ref 5710); Sat, 13 Mar 2010 19:58:02 +0000 Original-Received: (at 5710) by debbugs.gnu.org; 13 Mar 2010 19:57:25 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NqXSf-0002Dy-6l for submit@debbugs.gnu.org; Sat, 13 Mar 2010 14:57:25 -0500 Original-Received: from pantheon-po34.its.yale.edu ([130.132.50.80]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NqXSd-0002Dt-Sw for 5710@debbugs.gnu.org; Sat, 13 Mar 2010 14:57:24 -0500 Original-Received: from furry (173-14-147-246-NewEngland.hfc.comcastbusiness.net [173.14.147.246]) (authenticated bits=0) by pantheon-po34.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o2DJvI08027186 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 13 Mar 2010 14:57:19 -0500 Original-Received: by furry (Postfix, from userid 1000) id D52B2C011; Sat, 13 Mar 2010 14:57:18 -0500 (EST) X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 13 Mar 2010 14:58:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:35559 Archived-At: > (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?