aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 0bce83bfae7..71ab54bcab5 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -2174,6 +2174,11 @@ compact_small_strings (void)
2174 current_sblock = tb; 2174 current_sblock = tb;
2175} 2175}
2176 2176
2177void
2178string_overflow (void)
2179{
2180 error ("Maximum string size exceeded");
2181}
2177 2182
2178DEFUN ("make-string", Fmake_string, Smake_string, 2, 2, 0, 2183DEFUN ("make-string", Fmake_string, Smake_string, 2, 2, 0,
2179 doc: /* Return a newly created string of length LENGTH, with INIT in each element. 2184 doc: /* Return a newly created string of length LENGTH, with INIT in each element.
@@ -2206,7 +2211,7 @@ INIT must be an integer that represents a character. */)
2206 EMACS_INT string_len = XINT (length); 2211 EMACS_INT string_len = XINT (length);
2207 2212
2208 if (string_len > MOST_POSITIVE_FIXNUM / len) 2213 if (string_len > MOST_POSITIVE_FIXNUM / len)
2209 error ("Maximum string size exceeded"); 2214 string_overflow ();
2210 nbytes = len * string_len; 2215 nbytes = len * string_len;
2211 val = make_uninit_multibyte_string (string_len, nbytes); 2216 val = make_uninit_multibyte_string (string_len, nbytes);
2212 p = SDATA (val); 2217 p = SDATA (val);