aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2024-07-14 23:24:21 +0100
committerPaul Eggert2024-07-16 15:37:20 -0700
commitb4050ab75e896dd0df51624c956e0dd412dde2cc (patch)
treef2f019927434bcdaf9ad34b7dfa94ff09886b754
parenta4bafce01e605ddcfff7a4de018b50ad96ea6f8a (diff)
downloademacs-b4050ab75e896dd0df51624c956e0dd412dde2cc.tar.gz
emacs-b4050ab75e896dd0df51624c956e0dd412dde2cc.zip
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.
-rw-r--r--src/textconv.c4
1 files changed, 2 insertions, 2 deletions
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)
1741 1741
1742/* Return the confines of the field to which editing operations on frame 1742/* Return the confines of the field to which editing operations on frame
1743 F should be constrained in *BEG and *END. Should no field be active, 1743 F should be constrained in *BEG and *END. Should no field be active,
1744 set *END to MOST_POSITIVE_FIXNUM. */ 1744 set *END to PTRDIFF_MAX. */
1745 1745
1746void 1746void
1747get_conversion_field (struct frame *f, ptrdiff_t *beg, ptrdiff_t *end) 1747get_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)
1769 } 1769 }
1770 1770
1771 *beg = 1; 1771 *beg = 1;
1772 *end = MOST_POSITIVE_FIXNUM; 1772 *end = PTRDIFF_MAX;
1773} 1773}
1774 1774
1775/* Start a ``batch edit'' in frame F. During a batch edit, 1775/* Start a ``batch edit'' in frame F. During a batch edit,