From: Paul Eggert Date: Tue, 21 Jun 2011 01:40:45 +0000 (-0700) Subject: * xfont.c (xfont_match): Avoid need for strlen. X-Git-Tag: emacs-pretest-24.0.90~104^2~473^2~12 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7de51af53b40c4fcaa4369feffad11e9db11fbe0;p=emacs.git * xfont.c (xfont_match): Avoid need for strlen. --- diff --git a/src/ChangeLog b/src/ChangeLog index b1e30e68a0c..857b0fa79e2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2011-06-21 Paul Eggert + * xfont.c (xfont_match): Avoid need for strlen. + * xfns.c: Don't assume strlen fits in int. (xic_create_fontsetname, x_window): Use ptrdiff_t, not int. diff --git a/src/xfont.c b/src/xfont.c index 5dd6aae3846..2c3ca911623 100644 --- a/src/xfont.c +++ b/src/xfont.c @@ -594,16 +594,14 @@ xfont_match (Lisp_Object frame, Lisp_Object spec) { if (XGetFontProperty (xfont, XA_FONT, &value)) { - int len; char *s; s = (char *) XGetAtomName (display, (Atom) value); - len = strlen (s); /* If DXPC (a Differential X Protocol Compressor) Ver.3.7 is running, XGetAtomName will return null string. We must avoid such a name. */ - if (len > 0) + if (*s) { entity = font_make_entity (); ASET (entity, FONT_TYPE_INDEX, Qx);