aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/doc.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4613192187e..2677f03944f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -2,6 +2,11 @@
2 2
3 Integer and memory overflow issues (Bug#9196). 3 Integer and memory overflow issues (Bug#9196).
4 4
5 * doc.c (get_doc_string): Rework so that
6 get_doc_string_buffer_size is the actual buffer size, rather than
7 being 1 less than the actual buffer size; this makes xpalloc more
8 convenient.
9
5 * image.c (x_allocate_bitmap_record, cache_image): 10 * image.c (x_allocate_bitmap_record, cache_image):
6 * xselect.c (Fx_register_dnd_atom): 11 * xselect.c (Fx_register_dnd_atom):
7 Simplify previous changes by using xpalloc. 12 Simplify previous changes by using xpalloc.
diff --git a/src/doc.c b/src/doc.c
index eb8ff3c2521..83e943c42b8 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -166,19 +166,19 @@ get_doc_string (Lisp_Object filepos, int unibyte, int definition)
166 p = get_doc_string_buffer; 166 p = get_doc_string_buffer;
167 while (1) 167 while (1)
168 { 168 {
169 ptrdiff_t space_left = (get_doc_string_buffer_size 169 ptrdiff_t space_left = (get_doc_string_buffer_size - 1
170 - (p - get_doc_string_buffer)); 170 - (p - get_doc_string_buffer));
171 int nread; 171 int nread;
172 172
173 /* Allocate or grow the buffer if we need to. */ 173 /* Allocate or grow the buffer if we need to. */
174 if (space_left == 0) 174 if (space_left <= 0)
175 { 175 {
176 ptrdiff_t in_buffer = p - get_doc_string_buffer; 176 ptrdiff_t in_buffer = p - get_doc_string_buffer;
177 get_doc_string_buffer = 177 get_doc_string_buffer =
178 xpalloc (get_doc_string_buffer, &get_doc_string_buffer_size, 178 xpalloc (get_doc_string_buffer, &get_doc_string_buffer_size,
179 16 * 1024, -1, 1); 179 16 * 1024, -1, 1);
180 p = get_doc_string_buffer + in_buffer; 180 p = get_doc_string_buffer + in_buffer;
181 space_left = (get_doc_string_buffer_size 181 space_left = (get_doc_string_buffer_size - 1
182 - (p - get_doc_string_buffer)); 182 - (p - get_doc_string_buffer));
183 } 183 }
184 184