summaryrefslogtreecommitdiff
path: root/src/xrdb.c
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2013-08-09 16:25:34 +0400
committerDmitry Antipov <dmantipov@yandex.ru>2013-08-09 16:25:34 +0400
commit309f24d1ec07646fb1a090ee10fe456e79aea097 (patch)
tree19ba0104e3713ee963113a52f9b38107a3740b2a /src/xrdb.c
parent55902276706ea2db832ad5748a18ab392a0873f1 (diff)
downloademacs-309f24d1ec07646fb1a090ee10fe456e79aea097.tar.gz
Use xstrdup and build_unibyte_string where applicable.
* alloc.c (xstrdup): Tiny cleanup. Add eassert. * xfns.c (x_window): * xrdb.c (x_get_customization_string): * xterm.c (xim_initialize): * w32fns.c (w32_window): Use xstrdup. (w32_display_monitor_attributes_list): * emacs.c (init_cmdargs): * keyboard.c (PUSH_C_STR): * nsfont.m (nsfont_open): * sysdep.c (system_process_attributes): * w32.c (system_process_attributes): * xdisp.c (message1, message1_nolog): Use build_unibyte_string.
Diffstat (limited to 'src/xrdb.c')
-rw-r--r--src/xrdb.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/xrdb.c b/src/xrdb.c
index 7c9cd53fa8c..6ef5c3bcb41 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -75,18 +75,9 @@ x_get_customization_string (XrmDatabase db, const char *name,
sprintf (full_class, "%s.%s", class, "Customization");
result = x_get_string_resource (db, full_name, full_class);
-
- if (result)
- {
- char *copy = xmalloc (strlen (result) + 1);
- strcpy (copy, result);
- return copy;
- }
- else
- return 0;
+ return result ? xstrdup (result) : NULL;
}
-
/* Expand all the Xt-style %-escapes in STRING, whose length is given
by STRING_LEN. Here are the escapes we're supposed to recognize: