diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-08-18 01:37:41 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-08-18 01:37:41 -0700 |
commit | d31850da41f8dba08684acd2e8addd7127089404 (patch) | |
tree | 96c6d9e3d54243556def5ca7f45289384cf9f372 /src/doc.c | |
parent | bc81e2c4e885787603da3e0314d6ea45a43f7862 (diff) | |
download | emacs-d31850da41f8dba08684acd2e8addd7127089404.tar.gz |
* doc.c (get_doc_string): Rework so that
get_doc_string_buffer_size is the actual buffer size, rather than
being 1 less than the actual buffer size; this makes xpalloc more
convenient.
Diffstat (limited to 'src/doc.c')
-rw-r--r-- | src/doc.c | 6 |
1 files changed, 3 insertions, 3 deletions
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) p = get_doc_string_buffer; while (1) { - ptrdiff_t space_left = (get_doc_string_buffer_size + ptrdiff_t space_left = (get_doc_string_buffer_size - 1 - (p - get_doc_string_buffer)); int nread; /* Allocate or grow the buffer if we need to. */ - if (space_left == 0) + if (space_left <= 0) { ptrdiff_t in_buffer = p - get_doc_string_buffer; get_doc_string_buffer = xpalloc (get_doc_string_buffer, &get_doc_string_buffer_size, 16 * 1024, -1, 1); p = get_doc_string_buffer + in_buffer; - space_left = (get_doc_string_buffer_size + space_left = (get_doc_string_buffer_size - 1 - (p - get_doc_string_buffer)); } |