From 1e6879dbdb0832427f5c588c89a53a8a80768a00 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 25 Dec 2014 04:19:17 -0800 Subject: Prefer stpcpy to strcat * admin/merge-gnulib (GNULIB_MODULES): Add stpcpy. * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. * lib/stpcpy.c, m4/stpcpy.m4: New files, from gnulib. * lib-src/ebrowse.c (sym_scope_1, operator_name, open_file): * lib-src/emacsclient.c (get_server_config, set_local_socket) (start_daemon_and_retry_set_socket): * lib-src/etags.c (main, C_entries, relative_filename): * lib-src/pop.c (sendline): * lib-src/update-game-score.c (main): * lwlib/xlwmenu.c (resource_widget_value): * src/callproc.c (child_setup): * src/dbusbind.c (xd_signature_cat): * src/doc.c (get_doc_string, Fsnarf_documentation): * src/editfns.c (Fuser_full_name): * src/frame.c (xrdb_get_resource): * src/gtkutil.c (xg_get_file_with_chooser): * src/tparam.c (tparam1): * src/xfns.c (xic_create_fontsetname): * src/xrdb.c (gethomedir, get_user_db, get_environ_db): * src/xsmfns.c (smc_save_yourself_CB): Rewrite to avoid the need for strcat, typically by using stpcpy and/or lispstpcpy. strcat tends to be part of O(N**2) algorithms. * src/doc.c (sibling_etc): * src/xrdb.c (xdefaults): Now a top-level static constant. --- src/gtkutil.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gtkutil.c') diff --git a/src/gtkutil.c b/src/gtkutil.c index 9465d5479df..f61cbc2c85c 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -1839,12 +1839,12 @@ xg_get_file_with_chooser (struct frame *f, if (x_gtk_file_dialog_help_text) { - msgbuf[0] = '\0'; + char *z = msgbuf; /* Gtk+ 2.10 has the file name text entry box integrated in the dialog. Show the C-l help text only for versions < 2.10. */ if (gtk_check_version (2, 10, 0) && action != GTK_FILE_CHOOSER_ACTION_SAVE) - strcat (msgbuf, "\nType C-l to display a file name text entry box.\n"); - strcat (msgbuf, "\nIf you don't like this file selector, use the " + z = stpcpy (z, "\nType C-l to display a file name text entry box.\n"); + strcpy (z, "\nIf you don't like this file selector, use the " "corresponding\nkey binding or customize " "use-file-dialog to turn it off."); -- cgit v1.2.1