From 32fd8768093e21f1e812548d27c0bfd70cd82f78 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 31 May 2017 16:50:08 -0700 Subject: [PATCH] Fix bug with "%%" in error format * src/doprnt.c (doprnt): Format "%%" correctly. Problem reported by Philipp Stephani in: http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00901.html --- src/doprnt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/doprnt.c b/src/doprnt.c index bed9350f4a6..418601acb02 100644 --- a/src/doprnt.c +++ b/src/doprnt.c @@ -438,7 +438,9 @@ doprnt (char *buffer, ptrdiff_t bufsize, const char *format, } case '%': - fmt--; /* Drop thru and this % will be treated as normal */ + /* Treat this '%' as normal. */ + fmt0 = fmt - 1; + break; } } -- 2.39.2