From: Stefan Kangas Date: Sat, 20 Jul 2024 13:12:50 +0000 (+0200) Subject: Avoid magic values in xfont_list X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4c31ba26ffc1b4970be1af3f818f8753a854e459;p=emacs.git Avoid magic values in xfont_list * src/xfont.c (xfont_list): Avoid magic values. (cherry picked from commit 2f875ead59abe16c4559d26883ff1db524fa22f7) --- diff --git a/src/xfont.c b/src/xfont.c index b112bb4fb39..e439b954c5e 100644 --- a/src/xfont.c +++ b/src/xfont.c @@ -487,9 +487,9 @@ xfont_list (struct frame *f, Lisp_Object spec) if (NILP (list) && NILP (registry)) { /* Try iso10646-1 */ - char *r = name + len - 9; /* 9 == strlen (iso8859-1) */ + char *r = name + len - sizeof "iso8859-1" - 1; - if (r - name + 10 < 256) /* 10 == strlen (iso10646-1) */ + if (r - name + sizeof "iso10646-1" - 1 < 256) { strcpy (r, "iso10646-1"); list = xfont_list_pattern (display, name, Qiso10646_1, script);