From 4c31ba26ffc1b4970be1af3f818f8753a854e459 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 20 Jul 2024 15:12:50 +0200 Subject: [PATCH] Avoid magic values in xfont_list * src/xfont.c (xfont_list): Avoid magic values. (cherry picked from commit 2f875ead59abe16c4559d26883ff1db524fa22f7) --- src/xfont.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.39.2