diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2016-05-03 06:55:04 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2016-05-03 06:55:04 (GMT) |
commit | 67a30aba353edf66b8307395097eef5058050c16 (patch) | |
tree | 06bb18764fcde4bb847f83aeeaeb7bae97021a4a /src/glibext/gbuffersegment.c | |
parent | bbe0b6c2d6e19eeffbcabf3ea469b63c5f33a800 (diff) |
Fixed two bugs in the code buffer system.
Diffstat (limited to 'src/glibext/gbuffersegment.c')
-rw-r--r-- | src/glibext/gbuffersegment.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/glibext/gbuffersegment.c b/src/glibext/gbuffersegment.c index af77c38..3cbff1e 100644 --- a/src/glibext/gbuffersegment.c +++ b/src/glibext/gbuffersegment.c @@ -24,6 +24,7 @@ #include "gbuffersegment.h" +#include <malloc.h> #include <stdbool.h> #include <stdlib.h> #include <string.h> @@ -561,6 +562,7 @@ char *g_buffer_segment_get_text(const GBufferSegment *segment, bool markup) { char *result; /* Description à renvoyer */ char color[7]; /* Couleur hexadécimale */ + char *valid; /* Résolution du cas simple */ if (!markup) @@ -625,7 +627,13 @@ char *g_buffer_segment_get_text(const GBufferSegment *segment, bool markup) result = stradd(result, ">"); - result = stradd(result, segment->text); + valid = strdup(segment->text); + valid = strrpl(valid, "<", "<"); + valid = strrpl(valid, "&", "&"); + + result = stradd(result, valid); + + free(valid); result = stradd(result, "</span>"); |