[Github-comments] [geany/geany] editor: fix incorrect variable reference (#1561)

Colomban Wendling notifications at xxxxx
Thu Jul 27 01:05:11 UTC 2017


b4n commented on this pull request.



> @@ -2475,6 +2474,7 @@ void editor_insert_text_block(GeanyEditor *editor, const gchar *text, gint inser
 		/* count indent size up to insert_pos instead of asking sci
 		 * because there may be spaces after it */
 		gchar *tmp = sci_get_line(sci, line_start);
+		gint idx;
 
 		idx = insert_pos - sci_get_position_from_line(sci, line_start);

> I know it's not changed by this PR, but should the assertion above (L2465) be `g_return_if_fail(insert_pos > 0);` instead […]?

Why is that?  Isn't 0 the first position in the buffer, like for inserting at the very start?

Otherwise yeah this code could get a little more validation indeed.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1561#discussion_r129733452
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20170727/215e077e/attachment.html>


More information about the Github-comments mailing list