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
commit74815ce2e9b6458221c7bdf53ec2215c8c7baa4e (patch)
tree5e2e5e7441c06e3482f445a154d76e8a4a3d16de
parented4e980d89d366e967b754212fd226e8352e0f68 (diff)
downloadscintilla-mirror-74815ce2e9b6458221c7bdf53ec2215c8c7baa4e.tar.gz
Bug [#2102]. Explain behaviour when length argument longer than document.
-rw-r--r--doc/ScintillaDoc.html5
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index 8d6d54777..961babc34 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -469,8 +469,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