summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/arch/immediate.c17
2 files changed, 21 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d8c2850..cb6fff4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
17-04-28 Cyrille Bagard <nocbos@gmail.com>
* src/arch/immediate.c:
+ Escape some characters as needed when building tooltips.
+
+17-04-28 Cyrille Bagard <nocbos@gmail.com>
+
+ * src/arch/immediate.c:
RTFM to avoid segfaults when calling isprint().
17-04-27 Cyrille Bagard <nocbos@gmail.com>
diff --git a/src/arch/immediate.c b/src/arch/immediate.c
index 18c798d..88426de 100644
--- a/src/arch/immediate.c
+++ b/src/arch/immediate.c
@@ -1124,7 +1124,22 @@ static char *g_imm_operand_build_tooltip(const GImmOperand *operand, const GLoad
char *conv; /* Affichage de la Conversion */
if (operand->raw <= UCHAR_MAX && isprint(operand->raw))
- asprintf(&result, _("Character: '%c'"), (char)operand->raw);
+ switch (operand->raw)
+ {
+ case '&':
+ asprintf(&result, _("Character: '&amp;'"));
+ break;
+ case '<':
+ asprintf(&result, _("Character: '&lt;'"));
+ break;
+ case '>':
+ asprintf(&result, _("Character: '&gt;'"));
+ break;
+ default:
+ asprintf(&result, _("Character: '%c'"), (char)operand->raw);
+ break;
+ }
+
else
asprintf(&result, _("Character: &lt;not printable&gt;"));