diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2017-04-28 19:24:15 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2017-04-28 19:24:15 (GMT) |
commit | aeffe7a3bc85a2ddf30e309a59f14a0ecb7a824e (patch) | |
tree | f86f6af8032b1bc0e62bfb82539b9df61fc56e6a /src | |
parent | ac75fdb77854c6f6d2e8db97a474c8bf3af2b0c4 (diff) |
RTFM'ed to avoid segfaults when calling isprint().
Diffstat (limited to 'src')
-rw-r--r-- | src/arch/immediate.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/arch/immediate.c b/src/arch/immediate.c index 6ae7b66..18c798d 100644 --- a/src/arch/immediate.c +++ b/src/arch/immediate.c @@ -27,6 +27,7 @@ #include <assert.h> #include <ctype.h> #include <inttypes.h> +#include <limits.h> #include <malloc.h> #include <stdarg.h> #include <stdio.h> @@ -1122,7 +1123,7 @@ static char *g_imm_operand_build_tooltip(const GImmOperand *operand, const GLoad char value[IMM_MAX_SIZE]; /* Conversion artificielle */ char *conv; /* Affichage de la Conversion */ - if (isprint(operand->raw)) + if (operand->raw <= UCHAR_MAX && isprint(operand->raw)) asprintf(&result, _("Character: '%c'"), (char)operand->raw); else asprintf(&result, _("Character: <not printable>")); |