Fix last change in 'char_width'

* src/character.c (char_width): Make sure variable C is always
initialized.  (Bug#32276)
This commit is contained in:
Eli Zaretskii 2018-07-29 17:42:11 +03:00
parent 67679f0c08
commit 39d3e8b6bc

View file

@ -289,15 +289,18 @@ char_width (int c, struct Lisp_Char_Table *dp)
if (VECTORP (disp))
for (i = 0, width = 0; i < ASIZE (disp); i++)
{
int c;
int c = -1;
ch = AREF (disp, i);
if (GLYPH_CODE_P (ch))
c = GLYPH_CODE_CHAR (ch);
else if (CHARACTERP (ch))
c = XFASTINT (ch);
int w = CHARACTER_WIDTH (c);
if (INT_ADD_WRAPV (width, w, &width))
string_overflow ();
if (c >= 0)
{
int w = CHARACTER_WIDTH (c);
if (INT_ADD_WRAPV (width, w, &width))
string_overflow ();
}
}
}
return width;