diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/arch/immediate.c | 17 |
2 files changed, 21 insertions, 1 deletions
@@ -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: '&'")); + break; + case '<': + asprintf(&result, _("Character: '<'")); + break; + case '>': + asprintf(&result, _("Character: '>'")); + break; + default: + asprintf(&result, _("Character: '%c'"), (char)operand->raw); + break; + } + else asprintf(&result, _("Character: <not printable>")); |