From 2674ddc8af7c6056f3113709c673773e4a3712b7 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 21 Jun 2011 10:52:14 -0700 Subject: [PATCH] * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font): Avoid need for strlen. --- src/ChangeLog | 1 + src/xsettings.c | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index ad84e3271e4..1aafb12e07c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -3,6 +3,7 @@ * xsettings.c (apply_xft_settings): Fix potential buffer overrun. This is unlikely, but can occur if DPI is outlandish. + * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font): * xselect.c (Fx_get_atom_name): Avoid need for strlen. * xrdb.c: Don't assume strlen fits in int; avoid some strlens. diff --git a/src/xsettings.c b/src/xsettings.c index c8cb9529647..e2575650df9 100644 --- a/src/xsettings.c +++ b/src/xsettings.c @@ -711,9 +711,7 @@ DEFUN ("font-get-system-normal-font", Ffont_get_system_normal_font, doc: /* Get the system default application font. */) (void) { - return current_font - ? make_string (current_font, strlen (current_font)) - : Qnil; + return current_font ? build_string (current_font) : Qnil; } DEFUN ("font-get-system-font", Ffont_get_system_font, Sfont_get_system_font, @@ -721,9 +719,7 @@ DEFUN ("font-get-system-font", Ffont_get_system_font, Sfont_get_system_font, doc: /* Get the system default fixed width font. */) (void) { - return current_mono_font - ? make_string (current_mono_font, strlen (current_mono_font)) - : Qnil; + return current_mono_font ? build_string (current_mono_font) : Qnil; } DEFUN ("tool-bar-get-system-style", Ftool_bar_get_system_style, -- 2.39.2