summaryrefslogtreecommitdiff
path: root/src/indent.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-07-18 17:42:24 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-07-18 17:42:24 -0700
commit5637687fead7d57f73ea9a7677d25b93fb785dc7 (patch)
treee74204022166de1a8a17ed8860aa9197ce01428e /src/indent.c
parenta2271ba21087837896098f97663efaa60eab943e (diff)
downloademacs-5637687fead7d57f73ea9a7677d25b93fb785dc7.tar.gz
Don't assume that stated character widths fit in int.
* character.c (Fchar_width, c_string_width, lisp_string_width): * character.h (CHAR_WIDTH): * indent.c (MULTIBYTE_BYTES_WIDTH): Use sanitize_char_width to avoid undefined and/or bad behavior with outlandish widths. * character.h (sanitize_tab_width): Renamed from sanitize_width, now that we have two such functions. All uses changed. (sanitize_char_width): New inline function.
Diffstat (limited to 'src/indent.c')
-rw-r--r--src/indent.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/indent.c b/src/indent.c
index d89c7a9de03..8a2117751aa 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -284,7 +284,7 @@ skip_invisible (EMACS_INT pos, EMACS_INT *next_boundary_p, EMACS_INT to, Lisp_Ob
else \
{ \
if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, ch))) \
- width = ASIZE (DISP_CHAR_VECTOR (dp, ch)); \
+ width = sanitize_char_width (ASIZE (DISP_CHAR_VECTOR (dp, ch))); \
else \
width = CHAR_WIDTH (ch); \
} \