aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorJohn Wiegley2016-01-11 22:48:07 -0800
committerJohn Wiegley2016-01-11 22:48:07 -0800
commit9278e970c5319672a05c7bce6358af0e2794205b (patch)
treeb3a738be931667a47ecd86e36ad6a8359dcac037 /src/alloc.c
parenteb0643c74d391ac33168ba64351a2f318c850966 (diff)
parent6ee327d8a10047c1717358cc179ed8d1fb3389eb (diff)
downloademacs-9278e970c5319672a05c7bce6358af0e2794205b.tar.gz
emacs-9278e970c5319672a05c7bce6358af0e2794205b.zip
Merge from origin/emacs-25
6ee327d Add handle_user_signal_hook 47580e0 Avoid writing to purespace 0588be7 Remove unused variable 89e7483 * configure.ac: Find libxml2 headers in Xcode SDK dir on Darwin. 3b95e9c Use posix_openpt instead of openpty on Darwin 86312ff Document support for ':documentation' in Lisp mode c930e75b Document new features of TeX mode 7c83d84 Clarify docs of hscroll in RTL text 4c8f8db Fix rendering of HTML pages that use character composition a8d37ca Avoid some compiler warnings in w32.c ce106f3de Undo ill-advised change be0bba4 Unbreak completion in python-mode buffers
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/alloc.c b/src/alloc.c
index fe55cde49c9..49f5b7f18bc 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -2119,8 +2119,11 @@ INIT must be an integer that represents a character. */)
2119 { 2119 {
2120 nbytes = XINT (length); 2120 nbytes = XINT (length);
2121 val = make_uninit_string (nbytes); 2121 val = make_uninit_string (nbytes);
2122 memset (SDATA (val), c, nbytes); 2122 if (nbytes)
2123 SDATA (val)[nbytes] = 0; 2123 {
2124 memset (SDATA (val), c, nbytes);
2125 SDATA (val)[nbytes] = 0;
2126 }
2124 } 2127 }
2125 else 2128 else
2126 { 2129 {
@@ -2145,7 +2148,8 @@ INIT must be an integer that represents a character. */)
2145 memcpy (p, beg, len); 2148 memcpy (p, beg, len);
2146 } 2149 }
2147 } 2150 }
2148 *p = 0; 2151 if (nbytes)
2152 *p = 0;
2149 } 2153 }
2150 2154
2151 return val; 2155 return val;
@@ -3188,7 +3192,8 @@ allocate_vector (EMACS_INT len)
3188 if (min ((nbytes_max - header_size) / word_size, MOST_POSITIVE_FIXNUM) < len) 3192 if (min ((nbytes_max - header_size) / word_size, MOST_POSITIVE_FIXNUM) < len)
3189 memory_full (SIZE_MAX); 3193 memory_full (SIZE_MAX);
3190 v = allocate_vectorlike (len); 3194 v = allocate_vectorlike (len);
3191 v->header.size = len; 3195 if (len)
3196 v->header.size = len;
3192 return v; 3197 return v;
3193} 3198}
3194 3199