On Thu, Jan 05, 2017 at 05:06:42PM +0100, Fabian Maurer wrote:
It already works with a null-pointer, but will crash if len is -1. Since null-pointer means no text, we just return to avoid crashes.
v2: Followed suggestion by Nikolay Sivov, moved check and extend test
Actually, I'd prefer the NULL ptr check in fnTextSrv_TxSetText(), where it was in your first version. However, the extended test is much better.
Huw.
On Monday, January 9, 2017 1:17:43 PM CET Huw Davies wrote:
Actually, I'd prefer the NULL ptr check in fnTextSrv_TxSetText(), where it was in your first version. However, the extended test is much better.
Thanks for the feedback, I re-sent the original patch with the extended tests.
I also added a patch to move calculation of the length out of ME_InsertTextFromCursor since I find the code flow easier to follow that way. Now all checks are done before calling the function, and len always means length. Not sure what you think about that idea though, so feel free to reject that.
Fabian