From b85238397a4bfe4391e23029fce5ab6ff3fa2937 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Fri, 7 Dec 2001 13:35:25 +0000 Subject: [PATCH] (display_mode_element): Don't read past end of string if it ends with '%'. --- src/ChangeLog | 3 +++ src/xdisp.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 0759eb45bea..5dc65795829 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2001-12-07 Andreas Schwab + * xdisp.c (display_mode_element): Don't read past end of string if + it ends with '%'. + * alloc.c (inhibit_garbage_collection): Don't exceed value an int can hold. diff --git a/src/xdisp.c b/src/xdisp.c index d103230a698..91558067d1f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13461,7 +13461,7 @@ display_mode_line (w, face_id, format) FIELD_WIDTH is the number of characters the display of ELT should occupy in the mode line, and PRECISION is the maximum number of characters to display from ELT's representation. See - display_string for details. * + display_string for details. Returns the hpos of the end of the text generated by ELT. */ @@ -13584,6 +13584,8 @@ display_mode_element (it, depth, field_width, precision, elt) } } } + else /* c == 0 */ + break; } } } -- 2.39.2