aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorDmitry Antipov2013-08-09 16:25:34 +0400
committerDmitry Antipov2013-08-09 16:25:34 +0400
commit309f24d1ec07646fb1a090ee10fe456e79aea097 (patch)
tree19ba0104e3713ee963113a52f9b38107a3740b2a /src/alloc.c
parent55902276706ea2db832ad5748a18ab392a0873f1 (diff)
downloademacs-309f24d1ec07646fb1a090ee10fe456e79aea097.tar.gz
emacs-309f24d1ec07646fb1a090ee10fe456e79aea097.zip
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/alloc.c')
-rw-r--r--src/alloc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/alloc.c b/src/alloc.c
index c8141d22f95..19418bd6686 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -796,10 +796,8 @@ xpalloc (void *pa, ptrdiff_t *nitems, ptrdiff_t nitems_incr_min,
796char * 796char *
797xstrdup (const char *s) 797xstrdup (const char *s)
798{ 798{
799 size_t len = strlen (s) + 1; 799 eassert (s);
800 char *p = xmalloc (len); 800 return strcpy (xmalloc (strlen (s) + 1), s);
801 memcpy (p, s, len);
802 return p;
803} 801}
804 802
805/* Like putenv, but (1) use the equivalent of xmalloc and (2) the 803/* Like putenv, but (1) use the equivalent of xmalloc and (2) the