aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2018-07-29 17:42:11 +0300
committerEli Zaretskii2018-07-29 17:42:11 +0300
commit39d3e8b6bc465df7a9400165a4d813af8af37237 (patch)
tree7e8f0cb6b120a1ee08e695736a3287dc856cdc58 /src
parent67679f0c08755d972e8a85b63f8384e94aa18fc5 (diff)
downloademacs-39d3e8b6bc465df7a9400165a4d813af8af37237.tar.gz
emacs-39d3e8b6bc465df7a9400165a4d813af8af37237.zip
Fix last change in 'char_width'
* src/character.c (char_width): Make sure variable C is always initialized. (Bug#32276)
Diffstat (limited to 'src')
-rw-r--r--src/character.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/character.c b/src/character.c
index 48268e04947..b96161ebfcb 100644
--- a/src/character.c
+++ b/src/character.c
@@ -289,15 +289,18 @@ char_width (int c, struct Lisp_Char_Table *dp)
289 if (VECTORP (disp)) 289 if (VECTORP (disp))
290 for (i = 0, width = 0; i < ASIZE (disp); i++) 290 for (i = 0, width = 0; i < ASIZE (disp); i++)
291 { 291 {
292 int c; 292 int c = -1;
293 ch = AREF (disp, i); 293 ch = AREF (disp, i);
294 if (GLYPH_CODE_P (ch)) 294 if (GLYPH_CODE_P (ch))
295 c = GLYPH_CODE_CHAR (ch); 295 c = GLYPH_CODE_CHAR (ch);
296 else if (CHARACTERP (ch)) 296 else if (CHARACTERP (ch))
297 c = XFASTINT (ch); 297 c = XFASTINT (ch);
298 int w = CHARACTER_WIDTH (c); 298 if (c >= 0)
299 if (INT_ADD_WRAPV (width, w, &width)) 299 {
300 string_overflow (); 300 int w = CHARACTER_WIDTH (c);
301 if (INT_ADD_WRAPV (width, w, &width))
302 string_overflow ();
303 }
301 } 304 }
302 } 305 }
303 return width; 306 return width;