aboutsummaryrefslogtreecommitdiffstats
path: root/src/frame.c
diff options
context:
space:
mode:
authorDmitry Antipov2012-07-11 08:31:53 +0400
committerDmitry Antipov2012-07-11 08:31:53 +0400
commit984e7f300ef0bfec7be97c9bbaff5a6295a43aa2 (patch)
tree579e8e59109167073410ec78ea8c0ce5479c901f /src/frame.c
parent9d596af370080cba1e67978018d72a836dba008a (diff)
downloademacs-984e7f300ef0bfec7be97c9bbaff5a6295a43aa2.tar.gz
emacs-984e7f300ef0bfec7be97c9bbaff5a6295a43aa2.zip
Avoid calls to strlen in font processing functions.
* font.c (font_parse_name, font_parse_xlfd, font_parse_fcname) (font_open_by_name): Changed to use length argument. Adjust users accordingly. * font.h (font_open_by_name, font_parse_xlfd): Adjust prototypes. * xfont.c (xfont_decode_coding_xlfd): Changed to return ptrdiff_t. (xfont_list_pattern, xfont_match): Use length returned by xfont_decode_coding_xlfd. * xfns.c (x_default_font_parameter): Omit useless xstrdup.
Diffstat (limited to 'src/frame.c')
-rw-r--r--src/frame.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/frame.c b/src/frame.c
index 8d7981777bf..8f4bdc84a31 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -3167,7 +3167,7 @@ x_set_font (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
3167 fontset = fs_query_fontset (arg, 0); 3167 fontset = fs_query_fontset (arg, 0);
3168 if (fontset < 0) 3168 if (fontset < 0)
3169 { 3169 {
3170 font_object = font_open_by_name (f, SSDATA (arg)); 3170 font_object = font_open_by_name (f, SSDATA (arg), SBYTES (arg));
3171 if (NILP (font_object)) 3171 if (NILP (font_object))
3172 error ("Font `%s' is not defined", SSDATA (arg)); 3172 error ("Font `%s' is not defined", SSDATA (arg));
3173 arg = AREF (font_object, FONT_NAME_INDEX); 3173 arg = AREF (font_object, FONT_NAME_INDEX);
@@ -3176,7 +3176,7 @@ x_set_font (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
3176 { 3176 {
3177 Lisp_Object ascii_font = fontset_ascii (fontset); 3177 Lisp_Object ascii_font = fontset_ascii (fontset);
3178 3178
3179 font_object = font_open_by_name (f, SSDATA (ascii_font)); 3179 font_object = font_open_by_name (f, SSDATA (ascii_font), SBYTES (ascii_font));
3180 if (NILP (font_object)) 3180 if (NILP (font_object))
3181 error ("Font `%s' is not defined", SDATA (arg)); 3181 error ("Font `%s' is not defined", SDATA (arg));
3182 arg = AREF (font_object, FONT_NAME_INDEX); 3182 arg = AREF (font_object, FONT_NAME_INDEX);