Commit 52c61c22 authored by Paul Eggert's avatar Paul Eggert

* keyboard.c (parse_tool_bar_item): Avoid need for strlen.

parent 74ca2eb3
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
* image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]: * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
Don't assume string length fits in int. Don't assume string length fits in int.
* keyboard.c (parse_tool_bar_item):
* gtkutil.c (style_changed_cb): Avoid need for strlen. * gtkutil.c (style_changed_cb): Avoid need for strlen.
* font.c: Don't assume string length fits in int. * font.c: Don't assume string length fits in int.
......
...@@ -8225,7 +8225,7 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item) ...@@ -8225,7 +8225,7 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
/* `:label LABEL-STRING'. */ /* `:label LABEL-STRING'. */
PROP (TOOL_BAR_ITEM_LABEL) = STRINGP (value) PROP (TOOL_BAR_ITEM_LABEL) = STRINGP (value)
? value ? value
: make_string (bad_label, strlen (bad_label)); : build_string (bad_label);
have_label = 1; have_label = 1;
} }
else if (EQ (ikey, QCfilter)) else if (EQ (ikey, QCfilter))
...@@ -8291,7 +8291,7 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item) ...@@ -8291,7 +8291,7 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
else else
label = ""; label = "";
new_lbl = Fupcase_initials (make_string (label, strlen (label))); new_lbl = Fupcase_initials (build_string (label));
if (SCHARS (new_lbl) <= tool_bar_max_label_size) if (SCHARS (new_lbl) <= tool_bar_max_label_size)
PROP (TOOL_BAR_ITEM_LABEL) = new_lbl; PROP (TOOL_BAR_ITEM_LABEL) = new_lbl;
else else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment