Skip to content

Commit

Permalink
Propper NULL-terminate strings and fix an trailing space inside a tem…
Browse files Browse the repository at this point in the history
…plate
  • Loading branch information
frlan committed Apr 27, 2024
1 parent ddb0c93 commit 4ca8faa
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions latex/src/latexenvironments.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ void glatex_insert_environment(const gchar *environment, gint type)
environment,
"}{}\n%cursor%\n\\end{",
environment,
"}");
"}",
NULL);
}
else /* We don't have a block-like environment */
{
Expand All @@ -130,9 +131,10 @@ void glatex_insert_environment(const gchar *environment, gint type)
tmpstring = g_strconcat(
"\\begin{",
environment,
"}\n\t\\item %cursor% \n\\end{",
"}\n\t\\item %cursor%\n\\end{",
environment,
"}");
"}",
NULL);
}
else
{
Expand All @@ -141,7 +143,8 @@ void glatex_insert_environment(const gchar *environment, gint type)
environment,
"}\n%cursor%\n\\end{",
environment,
"}");
"}",
NULL);
}
}
glatex_insert_snippet(tmpstring);
Expand Down

0 comments on commit 4ca8faa

Please sign in to comment.