aboutsummaryrefslogtreecommitdiffstats
path: root/src/fontset.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/fontset.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/fontset.c')
-rw-r--r--src/fontset.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fontset.c b/src/fontset.c
index 056ef31e4f1..3397502a2fd 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1646,7 +1646,7 @@ FONT-SPEC is a vector, a cons, or a string. See the documentation of
1646 char xlfd[256]; 1646 char xlfd[256];
1647 int len; 1647 int len;
1648 1648
1649 if (font_parse_xlfd (SSDATA (name), font_spec) < 0) 1649 if (font_parse_xlfd (SSDATA (name), SBYTES (name), font_spec) < 0)
1650 error ("Fontset name must be in XLFD format"); 1650 error ("Fontset name must be in XLFD format");
1651 short_name = AREF (font_spec, FONT_REGISTRY_INDEX); 1651 short_name = AREF (font_spec, FONT_REGISTRY_INDEX);
1652 if (strncmp (SSDATA (SYMBOL_NAME (short_name)), "fontset-", 8) 1652 if (strncmp (SSDATA (SYMBOL_NAME (short_name)), "fontset-", 8)