From: Paul Eggert Date: Sun, 14 Jul 2024 22:24:21 +0000 (+0100) Subject: Fix get_conversion_field --with-wide-wint overflow X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f96cd9a42f2ffa262a3ffd9a71bb87a9baabccec;p=emacs.git Fix get_conversion_field --with-wide-wint overflow * src/textconv.c (get_conversion_field): Set max value to PTRDIFF_MAX, not MOST_POSITIVE_FIXNUM, since the variable is ptrdiff_t, not EMACS_INT. Problem caught by gcc -Woverflow on a 32-bit platform with --with-wide-int. (cherry picked from commit b4050ab75e896dd0df51624c956e0dd412dde2cc) --- diff --git a/src/textconv.c b/src/textconv.c index e3f928cd789..948f4c14725 100644 --- a/src/textconv.c +++ b/src/textconv.c @@ -1741,7 +1741,7 @@ handle_pending_conversion_events (void) /* Return the confines of the field to which editing operations on frame F should be constrained in *BEG and *END. Should no field be active, - set *END to MOST_POSITIVE_FIXNUM. */ + set *END to PTRDIFF_MAX. */ void get_conversion_field (struct frame *f, ptrdiff_t *beg, ptrdiff_t *end) @@ -1769,7 +1769,7 @@ get_conversion_field (struct frame *f, ptrdiff_t *beg, ptrdiff_t *end) } *beg = 1; - *end = MOST_POSITIVE_FIXNUM; + *end = PTRDIFF_MAX; } /* Start a ``batch edit'' in frame F. During a batch edit,