]> git.eshelyaron.com Git - emacs.git/commitdiff
(get_next_display_element): Use CHAR_STRING_NO_SIGNAL
authorGerd Moellmann <gerd@gnu.org>
Fri, 13 Jul 2001 09:30:21 +0000 (09:30 +0000)
committerGerd Moellmann <gerd@gnu.org>
Fri, 13 Jul 2001 09:30:21 +0000 (09:30 +0000)
instead of CHAR_STRING which can signal an error.

src/xdisp.c

index fb148ee8200a6a86180829bc4c9829fe787782c2..ba9e08dba49b00aa0e37845baf7e90ea2d9c74ee 100644 (file)
@@ -4227,7 +4227,22 @@ get_next_display_element (it)
                  if (SINGLE_BYTE_CHAR_P (it->c))
                    str[0] = it->c, len = 1;
                  else
-                   len = CHAR_STRING (it->c, str);
+                   {
+                     len = CHAR_STRING_NO_SIGNAL (it->c, str);
+                     if (len < 0)
+                       {
+                         /* It's an invalid character, which
+                            shouldn't happen actually, but due to
+                            bugs it may happen.  Let's print the char
+                            as is, there's not much meaningful we can
+                            do with it.  */
+                         str[0] = it->c;
+                         str[1] = it->c >> 8;
+                         str[2] = it->c >> 16;
+                         str[3] = it->c >> 24;
+                         len = 4;
+                       }
+                   }
 
                  for (i = 0; i < len; i++)
                    {