[latexila] BuildTools: bug fix in parser_text()
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [latexila] BuildTools: bug fix in parser_text()
- Date: Sun, 12 Apr 2015 14:20:59 +0000 (UTC)
commit 8b28b1ef142fceaba4adfb2f12c8b5b5368313ea
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sun Apr 12 13:58:54 2015 +0200
BuildTools: bug fix in parser_text()
The GMarkupParser documentation says that @text is not nul-terminated.
So use g_strndup(), I suppose that @text_len is in bytes.
src/liblatexila/latexila-build-tools.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/liblatexila/latexila-build-tools.c b/src/liblatexila/latexila-build-tools.c
index 8f9e0be..7faead0 100644
--- a/src/liblatexila/latexila-build-tools.c
+++ b/src/liblatexila/latexila-build-tools.c
@@ -293,7 +293,7 @@ parser_text (GMarkupParseContext *context,
{
LatexilaBuildTools *build_tools = user_data;
const gchar *element_name = g_markup_parse_context_get_element (context);
- gchar *stripped_text = g_strdup (text);
+ gchar *stripped_text = g_strndup (text, text_len);
stripped_text = g_strstrip (stripped_text);
if (g_str_equal (element_name, "job"))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]