> +     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

Reply via email to