[Github-comments] [geany-plugins] Add new "Lineoperations" plugin (#324)

Sylvan Mostert notifications at xxxxx
Tue Jan 12 18:25:50 UTC 2016


> +	gint  numlines;         // number of lines in **lines array
> +	gchar *newfile;         // *final* string to replace current document
> +	gint  nfposn;           // keeps track of the position of newfile string
> +	gint  i;                // iterator
> +	gint  j;                // iterator
> +	gint  k;                // iterator
> +
> +	totalnumchars = sci_get_length(doc->editor->sci);
> +	totalnumlines = sci_get_line_count(doc->editor->sci);
> +	lines         = g_malloc(sizeof(gchar *) * totalnumlines);
> +	newfile       = g_malloc(sizeof(gchar) * (totalnumchars+1));
> +	numlines      = 0;
> +	nfposn        = 0;
> +	k             = 0;
> +
> +	if(newfile && lines)    // verify memory allocation

Thanks, this is now updated. I decided to keep g_malloc and remove the null check since it is unnecessary  as "GLib/GTK/Geany will most likely abort anyways.

---
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/324/files#r49492710
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20160112/a626f7e6/attachment.html>


More information about the Github-comments mailing list