aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorZufu Liu <unknown>2019-05-04 11:32:21 +1000
committerZufu Liu <unknown>2019-05-04 11:32:21 +1000
commit957df113f89a3a79e20d1a3287f7c368c3161c6f (patch)
tree806514db3f15fcbbe5c836a5ed2c8e7b23505e83
parent19119c5118b845f3bfd0b0c63441336019ecc351 (diff)
downloadscintilla-mirror-957df113f89a3a79e20d1a3287f7c368c3161c6f.tar.gz
Backport: Bug [#2102]. Explain behaviour when length argument longer than document.
Backport of changeset 7491:f72740cc5975.
-rw-r--r--doc/ScintillaDoc.html5
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index 10f256594..eb803c2c6 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -466,8 +466,9 @@
</code>
<p><b id="SCI_GETTEXT">SCI_GETTEXT(int length, char *text NUL-terminated) &rarr; int</b><br />
- This returns <code class="parameter">length</code>-1 characters of text from the start of the document plus one
- terminating 0 character. To collect all the text in a document, use <code>SCI_GETLENGTH</code>
+ This returns at most <code class="parameter">length</code>-1 characters of text from the start of the document plus one
+ terminating 0 character. When <code class="parameter">length</code>-1 is beyond document length, it returns document length.
+ To collect all the text in a document, use <code>SCI_GETLENGTH</code>
to get the number of characters in the document (<code>nLen</code>), allocate a character
buffer of length <code>nLen+1</code> bytes, then call <code>SCI_GETTEXT(nLen+1, char
*text)</code>. If the text argument is 0 then the length that should be allocated to store the