all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Glenn Morris <rgm@gnu.org>, 29609@debbugs.gnu.org
Cc: gustaf.waldemarson@gmail.com
Subject: bug#29609: 27.0.50; Format number as hexadecimal with hash-flag
Date: Fri, 8 Dec 2017 13:31:21 -0800	[thread overview]
Message-ID: <02ae6545-0c6d-84a2-f0b6-4ff721f52c5a@cs.ucla.edu> (raw)
In-Reply-To: <o7lgidxg4o.fsf@fencepost.gnu.org>

[-- Attachment #1: Type: text/plain, Size: 203 bytes --]

On 12/08/2017 09:51 AM, Glenn Morris wrote:
> Could there be something wrong with 47423f0?

Yes there could, and thanks for reporting it. I installed the attached 
to fix the bug I recently introduced.


[-- Attachment #2: 0001-Fix-core-dump-from-format-08x-n-patch.patch --]
[-- Type: text/x-patch, Size: 859 bytes --]

From c9d450ffcc755c4af39c2ab5a9e585f05eeddf94 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Fri, 8 Dec 2017 13:30:06 -0800
Subject: [PATCH] Fix core dump from (format "%#08x" n) patch

Problem reported by Glenn Morris (Bug#29609#13).
* src/editfns.c (styled_format): Null-terminate output,
as later code now expects this.
---
 src/editfns.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/editfns.c b/src/editfns.c
index ebf6518994..084d92346f 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -4623,6 +4623,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
 		  /* Don't use sprintf here, as it might mishandle prec.  */
 		  sprintf_buf[0] = XINT (arg);
 		  sprintf_bytes = prec != 0;
+		  sprintf_buf[sprintf_bytes] = '\0';
 		}
 	      else if (conversion == 'd' || conversion == 'i')
 		{
-- 
2.14.3


      reply	other threads:[~2017-12-08 21:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-07 21:02 bug#29609: 27.0.50; Format number as hexadecimal with hash-flag Gustaf Waldemarson
2017-12-08  2:14 ` Paul Eggert
2017-12-08 17:51   ` Glenn Morris
2017-12-08 21:31     ` Paul Eggert [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=02ae6545-0c6d-84a2-f0b6-4ff721f52c5a@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=29609@debbugs.gnu.org \
    --cc=gustaf.waldemarson@gmail.com \
    --cc=rgm@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.