From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 07 16:32:58 2017 Received: (at submit) by debbugs.gnu.org; 7 Dec 2017 21:32:58 +0000 Received: from localhost ([127.0.0.1]:51024 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eN3mr-0006qk-Ob for submit@debbugs.gnu.org; Thu, 07 Dec 2017 16:32:58 -0500 Received: from eggs.gnu.org ([208.118.235.92]:45851) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eN3Jf-00069Q-Mj for submit@debbugs.gnu.org; Thu, 07 Dec 2017 16:02:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eN3JZ-0003Pw-73 for submit@debbugs.gnu.org; Thu, 07 Dec 2017 16:02:42 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:40909) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eN3JZ-0003Po-4E for submit@debbugs.gnu.org; Thu, 07 Dec 2017 16:02:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eN3JX-0000n5-LB for bug-gnu-emacs@gnu.org; Thu, 07 Dec 2017 16:02:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eN3JW-0003Nv-Fy for bug-gnu-emacs@gnu.org; Thu, 07 Dec 2017 16:02:39 -0500 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:42535) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eN3JW-0003NO-5U for bug-gnu-emacs@gnu.org; Thu, 07 Dec 2017 16:02:38 -0500 Received: by mail-wm0-x236.google.com with SMTP id l141so173399wmg.1 for ; Thu, 07 Dec 2017 13:02:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=y62CWicCfTRsl4/T3b7AtClvqsKaemqIKMZXi9IX78s=; b=rU+8JG9QH2X6bvUGvoYcg5lRcsyUfFgiQzUE6o45JqRmx3GZp7fjkkiT42FP6wI8v8 LQx22dpH5wXz6OND6EbTBLZVuhKwbV7uAdLCwaVo+EZtLYFF04rwfRyIXPJHBMQsTW9N ht+hZYWxOAFsr6dnMOWQLge1cODyoeoOCfjZ88U2YgoSINoeo8Fygw9L28YzMbiCTjx9 pAXJ7jf97U39psMlMYoC2sxg27YUTxazcVfB03YgWHIFO+OBc5YzcFQwTgedTjQeeaIY Dq3j3hXPJIs0TDM80n6mQS57c7tKUJzNuWriVcBPdx5DL3/S4v8Imly4lyXXR7CU67DO TnSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=y62CWicCfTRsl4/T3b7AtClvqsKaemqIKMZXi9IX78s=; b=FvSQyLn9vNEbNDgyTQLfjcvqMvfNTPV+Oa5PlzrpqyEJz+uaaYswPq1+gOwNWvmqi0 N+DYrh6BMpGawYpAktTNEIFmsqw0nwMnitDIvsJboaXgp79VZNDYQGtvlA6VARebJKWp 4b+2dPo0vY/ofkfnzl1QymcD5Nz2COxl11P1Y7o4vBjwUshjS/KCLepVRT0TINPO/e0K Vb7pR1/cU9/i8nBaS+RgpUWpV87+EVlzzA5WFncgSmI+hVPkvTk1F1ZrGkpNrExcJhx9 tQyUzp+LvhwcWmapfHXoRpzYpqkbYHreIPRqXjzh97Jv59mf/ixIuBLAWHIIeFZoz7+i CeHg== X-Gm-Message-State: AJaThX5YFB9psDCT8R4ETzlu62qr9fCeo2ARSjmGP9h1u6k1hehgqpFN kA+clZXXOnh3AvftOXADAvAiOH9rdnuwFToaoIqNfm0X X-Google-Smtp-Source: AGs4zMYnIAdEMaic9rZqYD83e0nZM5AeV1VhOKEloZ1AN7D6xCrTtowP4DwFFTwtkuxvNhQYrsQ6LNVs2ijH0N0/SPA= X-Received: by 10.80.133.193 with SMTP id q1mr46374958edh.50.1512680555745; Thu, 07 Dec 2017 13:02:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.144.186 with HTTP; Thu, 7 Dec 2017 13:02:34 -0800 (PST) From: Gustaf Waldemarson Date: Thu, 7 Dec 2017 22:02:34 +0100 Message-ID: Subject: 27.0.50; Format number as hexadecimal with hash-flag To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset="UTF-8" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 07 Dec 2017 16:32:57 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Hello, I recently noticed that the `format` function behaves incorrectly when formatting numbers as hexadecimal together with the hash-flag. E.g., following this recipe yields: 1. M-x ielm 2. Evaluate: (format "%#08x" #x10) -> "00000x10" Typically Bash, C and other formatting implementations typically formats this as "0x00000010", and I think Emacs should do the same in this case. This seems to be present in a few different versions of Emacs, I've tried it on 24.5.1 and 27.0.50 and they both behave the same. Regards, Gustaf In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-11-29 built on ShadowX Repository revision: 95369ac346d75a7b75bc2c5adf632cc4faa1241a Windowing system distributor 'The X.Org Foundation', version 11.0.11903000 System Description: Ubuntu 17.04 Recent messages: scroll-down-command: Beginning of buffer Mark set (rectangle mode) When done with a buffer, type C-x # Configuring package message...done Configuring package git-commit...done Configuring package magit...done [2 times] When done with a buffer, type C-x # [2 times] Making completion list... [2 times] delete-backward-char: Text is read-only Making completion list... Configured using: 'configure --prefix=/home/xaldew/.local '--program-transform-name=s/^ctags$/ctags.emacs/'' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS NOTIFY GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 LCMS2 Important settings: value of $LANG: sv_SE.UTF-8 locale-coding-system: utf-8-unix Major mode: IELM Minor modes in effect: diff-auto-refine-mode: t global-git-commit-mode: t async-bytecomp-package-mode: t beacon-mode: t flycheck-pos-tip-mode: t projectile-mode: t hes-mode: t global-linum-mode: t linum-mode: t yas-global-mode: t yas-minor-mode: t global-company-mode: t company-mode: t global-anzu-mode: t anzu-mode: t perspeen-mode: t global-atomic-chrome-edit-mode: t shell-dirtrack-mode: t global-undo-tree-mode: t undo-tree-mode: t which-key-mode: t anyclip-mode: t override-global-mode: t electric-pair-mode: t save-place-mode: t global-subword-mode: t subword-mode: t show-paren-mode: t winner-mode: t global-auto-revert-mode: t xterm-mouse-mode: t savehist-mode: t ido-everywhere: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort bbdb-message mail-extr emacsbug sendmail ielm pp magit-obsolete magit-blame magit-stash magit-bisect magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-branch magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log magit-diff smerge-mode diff-mode magit-core magit-autorevert magit-process magit-margin magit-mode magit-git magit-section magit-popup git-commit magit-utils crm log-edit message rmc puny rfc822 mml mml-sec epa derived epg mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader pcvs-util add-log with-editor async-bytecomp async unfill org-rmail org-mhe org-irc org-info org-gnus gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils org-docview doc-view jka-compr image+ image-file image-mode org-bibtex bibtex org-bbdb org-w3m org-table org-element avl-tree generator ob-latex ob-plantuml ob-org ob-shell ob-gnuplot ob-python ob-ditaa ob-dot org org-macro org-footnote org-pcomplete org-list org-faces org-entities org-version ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint ob-core ob-eval org-compat org-macs org-loaddefs holidays hol-loaddefs cal-menu calendar cal-loaddefs markdown-mode noutline outline dired dired-loaddefs term/tmux term/xterm xterm smart-mode-line-dark-theme smart-mode-line rich-minority beacon server flymake-proc flymake warnings auto-complete-config auto-complete form-feed paredit nameless lisp-mnt flyspell ispell whitespace flycheck-irony irony-diagnostics irony irony-iotask flycheck-popup-tip popup flycheck-pos-tip pos-tip flycheck find-func subr-x dash rainbow-delimiters projectile grep ibuf-ext ibuffer ibuffer-loaddefs ggtags compile ewoc highlight-escape-sequences linum yasnippet company-oddmuse company-keywords company-etags etags xref project company-gtags company-dabbrev-code company-dabbrev company-files company-capf company-cmake company-xcode company-clang company-semantic company-eclim company-css company-nxml company-bbdb company-template company pcase anzu thingatpt perspeen perspeen-tab powerline powerline-separators powerline-themes atomic-chrome websocket url-cookie url-domsuf url-util bindat let-alist json map color-theme-approximate color tramp tramp-compat tramp-loaddefs trampver ucs-normalize shell pcomplete comint ansi-color parse-time format-spec delim-col hydra-examples windmove rect hydra lv bbdb bbdb-site timezone cus-edit cus-start cus-load wid-edit ace-link avy google-c-style undo-tree diff cl-extra help-mode which-key advice anyclip-mode diminish use-package bind-key easy-mmode finder-inf autoinsert tex-site edmacro kmacro rx info package epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache url-vars local-autoloads cwarn cc-mode cc-fonts easymenu cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs elec-pair saveplace cap-words superword subword time-date paren winner ring autorevert filenotify xt-mouse tango-dark-theme savehist ido seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib keybinds terminals mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 546994 37401) (symbols 48 49359 3) (miscs 40 1210 530) (strings 32 135385 7494) (string-bytes 1 4760808) (vectors 16 81794) (vector-slots 8 1291186 11024) (floats 8 690 550) (intervals 56 2095 794) (buffers 992 109)) From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 07 21:14:22 2017 Received: (at 29609-done) by debbugs.gnu.org; 8 Dec 2017 02:14:22 +0000 Received: from localhost ([127.0.0.1]:51206 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eN8BC-0004VL-5Z for submit@debbugs.gnu.org; Thu, 07 Dec 2017 21:14:22 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:56990) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eN8BA-0004V7-7g for 29609-done@debbugs.gnu.org; Thu, 07 Dec 2017 21:14:20 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 58C51161275; Thu, 7 Dec 2017 18:14:14 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id AQCeOkGkiUCD; Thu, 7 Dec 2017 18:14:13 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 7E02D161282; Thu, 7 Dec 2017 18:14:13 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id XQ3ENMY-NQez; Thu, 7 Dec 2017 18:14:13 -0800 (PST) Received: from [192.168.1.9] (unknown [47.154.30.119]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 58B40160F8E; Thu, 7 Dec 2017 18:14:13 -0800 (PST) To: Gustaf Waldemarson From: Paul Eggert Subject: Re: 27.0.50; Format number as hexadecimal with hash-flag Organization: UCLA Computer Science Department Message-ID: Date: Thu, 7 Dec 2017 18:14:13 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------76BBF95B116CC6D10B60237A" Content-Language: en-US X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 29609-done Cc: 29609-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This is a multi-part message in MIME format. --------------76BBF95B116CC6D10B60237A Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Thanks for reporting that. I installed the attached, which should fix the bug. --------------76BBF95B116CC6D10B60237A Content-Type: text/x-patch; name="0001-Fix-zero-padding-bug-with-format-08x-n.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Fix-zero-padding-bug-with-format-08x-n.patch" >From 47423f0603f2ecfb78352be5477fb02c44f1fd35 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 7 Dec 2017 18:07:54 -0800 Subject: [PATCH] Fix zero-padding bug with (format "%#08x" n) Problem reported by Gustaf Waldemarson (Bug#29609). * src/editfns.c (styled_format): Put zero padding after a leading "0x", not before. * test/src/editfns-tests.el (format-sharp-0-x): New test. --- src/editfns.c | 24 ++++++++++++++++-------- test/src/editfns-tests.el | 6 ++++++ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/editfns.c b/src/editfns.c index e671ba0..ebf6518 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -4722,11 +4722,19 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) char src0 = src[0]; int exponent_bytes = 0; bool signedp = src0 == '-' || src0 == '+' || src0 == ' '; - unsigned char after_sign = src[signedp]; - if (zero_flag && 0 <= char_hexdigit (after_sign)) + int prefix_bytes = (signedp + + ((src[signedp] == '0' + && (src[signedp + 1] == 'x' + || src[signedp + 1] == 'X')) + ? 2 : 0)); + if (zero_flag) { - leading_zeros += padding; - padding = 0; + unsigned char after_prefix = src[prefix_bytes]; + if (0 <= char_hexdigit (after_prefix)) + { + leading_zeros += padding; + padding = 0; + } } if (excess_precision @@ -4745,13 +4753,13 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) nchars += padding; } - *p = src0; - src += signedp; - p += signedp; + memcpy (p, src, prefix_bytes); + p += prefix_bytes; + src += prefix_bytes; memset (p, '0', leading_zeros); p += leading_zeros; int significand_bytes - = sprintf_bytes - signedp - exponent_bytes; + = sprintf_bytes - prefix_bytes - exponent_bytes; memcpy (p, src, significand_bytes); p += significand_bytes; src += significand_bytes; diff --git a/test/src/editfns-tests.el b/test/src/editfns-tests.el index 70dc937..283a642 100644 --- a/test/src/editfns-tests.el +++ b/test/src/editfns-tests.el @@ -136,6 +136,12 @@ transpose-test-get-byte-positions (ert-deftest format-c-float () (should-error (format "%c" 0.5))) +;;; Test for Bug#29609. +(ert-deftest format-sharp-0-x () + (should (string-equal (format "%#08x" #x10) "0x000010")) + (should (string-equal (format "%#05X" #x10) "0X010")) + (should (string-equal (format "%#04x" 0) "0000"))) + ;;; Check format-time-string with various TZ settings. ;;; Use only POSIX-compatible TZ values, since the tests should work ;;; even if tzdb is not in use. -- 2.7.4 --------------76BBF95B116CC6D10B60237A-- From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 08 12:51:28 2017 Received: (at 29609) by debbugs.gnu.org; 8 Dec 2017 17:51:28 +0000 Received: from localhost ([127.0.0.1]:52797 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNMo4-00050K-Iw for submit@debbugs.gnu.org; Fri, 08 Dec 2017 12:51:28 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50305) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNMo3-000507-Cr for 29609@debbugs.gnu.org; Fri, 08 Dec 2017 12:51:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNMnx-0002gn-Fv for 29609@debbugs.gnu.org; Fri, 08 Dec 2017 12:51:22 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43216) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNMnx-0002gj-Bz; Fri, 08 Dec 2017 12:51:21 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1eNMnv-0001hK-Og; Fri, 08 Dec 2017 12:51:19 -0500 From: Glenn Morris To: 29609@debbugs.gnu.org Subject: Re: bug#29609: 27.0.50; Format number as hexadecimal with hash-flag References: X-Spook: Croatian CBNRC Crypto AG Al Qaida Attack SSL Domestic X-Ran: G|%6"Z#W{H}BC9l2@+{3R>.iY?>kL<\j]Xwrf/VYY%D$u!s_a%:B*Pwgz?lcY^EmFc5he| X-Hue: black X-Debbugs-No-Ack: yes X-Attribution: GM Date: Fri, 08 Dec 2017 12:51:19 -0500 In-Reply-To: (Paul Eggert's message of "Thu, 7 Dec 2017 18:14:13 -0800") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 29609 Cc: eggert@cs.ucla.edu, gustaf.waldemarson@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Since 47423f0, three bootstraps in a row have failed for me on RHEL7.4, with a segfault at some random point in the build. Eg: /bin/sh: line 1: 26588 Segmentation fault (core dumped) EMACSLOADPATH= '../src/emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -f batch-byte-compile calc/calc-keypd.el make[2]: *** [calc/calc-keypd.elc] Error 139 Could be a coincidence, but before this change I haven't had such failures. Could there be something wrong with 47423f0? From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 08 16:31:29 2017 Received: (at 29609) by debbugs.gnu.org; 8 Dec 2017 21:31:30 +0000 Received: from localhost ([127.0.0.1]:52947 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNQEz-0007ZQ-KL for submit@debbugs.gnu.org; Fri, 08 Dec 2017 16:31:29 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:33110) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNQEy-0007ZE-Gk for 29609@debbugs.gnu.org; Fri, 08 Dec 2017 16:31:29 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 96068160F9F; Fri, 8 Dec 2017 13:31:22 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 3MXnfQFxwrSc; Fri, 8 Dec 2017 13:31:21 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id A12C516138C; Fri, 8 Dec 2017 13:31:21 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id MHrivKytQ1i6; Fri, 8 Dec 2017 13:31:21 -0800 (PST) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 83A03161383; Fri, 8 Dec 2017 13:31:21 -0800 (PST) Subject: Re: bug#29609: 27.0.50; Format number as hexadecimal with hash-flag To: Glenn Morris , 29609@debbugs.gnu.org References: From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <02ae6545-0c6d-84a2-f0b6-4ff721f52c5a@cs.ucla.edu> Date: Fri, 8 Dec 2017 13:31:21 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------A4B5911CD60134D5D398D54B" Content-Language: en-US X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 29609 Cc: gustaf.waldemarson@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This is a multi-part message in MIME format. --------------A4B5911CD60134D5D398D54B Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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. --------------A4B5911CD60134D5D398D54B Content-Type: text/x-patch; name="0001-Fix-core-dump-from-format-08x-n-patch.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Fix-core-dump-from-format-08x-n-patch.patch" >From c9d450ffcc755c4af39c2ab5a9e585f05eeddf94 Mon Sep 17 00:00:00 2001 From: Paul Eggert 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 --------------A4B5911CD60134D5D398D54B-- From unknown Mon Aug 18 11:11:02 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 06 Jan 2018 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator