changeset 101422:9e1fcd81389c

(font_parse_xlfd): Handle patterns of length < 2.
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 24 Jan 2009 03:17:42 +0000
parents 112b0c79b63d
children 3717d9675f49
files src/font.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/font.c	Sat Jan 24 03:17:32 2009 +0000
+++ b/src/font.c	Sat Jan 24 03:17:42 2009 +0000
@@ -1066,11 +1066,11 @@
   Lisp_Object val;
   char *p;
 
-  if (len > 255)
+  if (len > 255 || !len)
     /* Maximum XLFD name length is 255. */
     return -1;
   /* Accept "*-.." as a fully specified XLFD. */
-  if (name[0] == '*' && name[1] == '-')
+  if (name[0] == '*' && (len == 1 || name[1] == '-'))
     i = 1, f[XLFD_FOUNDRY_INDEX] = name;
   else
     i = 0;