summaryrefslogtreecommitdiff
path: root/src/arch/x86
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86')
-rw-r--r--src/arch/x86/registers.c96
1 files changed, 48 insertions, 48 deletions
diff --git a/src/arch/x86/registers.c b/src/arch/x86/registers.c
index 18756b3..f3209bb 100644
--- a/src/arch/x86/registers.c
+++ b/src/arch/x86/registers.c
@@ -272,28 +272,28 @@ static void g_x86_register_to_string(const GX86Register *reg, AsmSyntax syntax,
switch (reg->reg.reg8)
{
case X86_REG8_AL:
- snprintf(key, 5, "al");
+ snprintf(key, MAX_REGNAME_LEN, "al");
break;
case X86_REG8_CL:
- snprintf(key, 5, "cl");
+ snprintf(key, MAX_REGNAME_LEN, "cl");
break;
case X86_REG8_DL:
- snprintf(key, 5, "dl");
+ snprintf(key, MAX_REGNAME_LEN, "dl");
break;
case X86_REG8_BL:
- snprintf(key, 5, "bl");
+ snprintf(key, MAX_REGNAME_LEN, "bl");
break;
case X86_REG8_AH:
- snprintf(key, 5, "ah");
+ snprintf(key, MAX_REGNAME_LEN, "ah");
break;
case X86_REG8_CH:
- snprintf(key, 5, "ch");
+ snprintf(key, MAX_REGNAME_LEN, "ch");
break;
case X86_REG8_DH:
- snprintf(key, 5, "dh");
+ snprintf(key, MAX_REGNAME_LEN, "dh");
break;
case X86_REG8_BH:
- snprintf(key, 5, "bh");
+ snprintf(key, MAX_REGNAME_LEN, "bh");
break;
case X86_REG8_NONE:
/* Ne devrait jamais arriver */
@@ -306,28 +306,28 @@ static void g_x86_register_to_string(const GX86Register *reg, AsmSyntax syntax,
switch (reg->reg.reg16)
{
case X86_REG16_AX:
- snprintf(key, 5, "ax");
+ snprintf(key, MAX_REGNAME_LEN, "ax");
break;
case X86_REG16_CX:
- snprintf(key, 5, "cx");
+ snprintf(key, MAX_REGNAME_LEN, "cx");
break;
case X86_REG16_DX:
- snprintf(key, 5, "dx");
+ snprintf(key, MAX_REGNAME_LEN, "dx");
break;
case X86_REG16_BX:
- snprintf(key, 5, "bx");
+ snprintf(key, MAX_REGNAME_LEN, "bx");
break;
case X86_REG16_SP:
- snprintf(key, 5, "sp");
+ snprintf(key, MAX_REGNAME_LEN, "sp");
break;
case X86_REG16_BP:
- snprintf(key, 5, "bp");
+ snprintf(key, MAX_REGNAME_LEN, "bp");
break;
case X86_REG16_SI:
- snprintf(key, 5, "si");
+ snprintf(key, MAX_REGNAME_LEN, "si");
break;
case X86_REG16_DI:
- snprintf(key, 5, "di");
+ snprintf(key, MAX_REGNAME_LEN, "di");
break;
case X86_REG16_NONE:
/* Ne devrait jamais arriver */
@@ -340,28 +340,28 @@ static void g_x86_register_to_string(const GX86Register *reg, AsmSyntax syntax,
switch (reg->reg.reg32)
{
case X86_REG32_EAX:
- snprintf(key, 5, "eax");
+ snprintf(key, MAX_REGNAME_LEN, "eax");
break;
case X86_REG32_ECX:
- snprintf(key, 5, "ecx");
+ snprintf(key, MAX_REGNAME_LEN, "ecx");
break;
case X86_REG32_EDX:
- snprintf(key, 5, "edx");
+ snprintf(key, MAX_REGNAME_LEN, "edx");
break;
case X86_REG32_EBX:
- snprintf(key, 5, "ebx");
+ snprintf(key, MAX_REGNAME_LEN, "ebx");
break;
case X86_REG32_ESP:
- snprintf(key, 5, "esp");
+ snprintf(key, MAX_REGNAME_LEN, "esp");
break;
case X86_REG32_EBP:
- snprintf(key, 5, "ebp");
+ snprintf(key, MAX_REGNAME_LEN, "ebp");
break;
case X86_REG32_ESI:
- snprintf(key, 5, "esi");
+ snprintf(key, MAX_REGNAME_LEN, "esi");
break;
case X86_REG32_EDI:
- snprintf(key, 5, "edi");
+ snprintf(key, MAX_REGNAME_LEN, "edi");
break;
case X86_REG32_NONE:
printf("null reg\n");
@@ -384,28 +384,28 @@ static void g_x86_register_to_string(const GX86Register *reg, AsmSyntax syntax,
switch (reg->reg.reg8)
{
case X86_REG8_AL:
- snprintf(key, 5, "%%al");
+ snprintf(key, MAX_REGNAME_LEN, "%%al");
break;
case X86_REG8_CL:
- snprintf(key, 5, "%%cl");
+ snprintf(key, MAX_REGNAME_LEN, "%%cl");
break;
case X86_REG8_DL:
- snprintf(key, 5, "%%dl");
+ snprintf(key, MAX_REGNAME_LEN, "%%dl");
break;
case X86_REG8_BL:
- snprintf(key, 5, "%%bl");
+ snprintf(key, MAX_REGNAME_LEN, "%%bl");
break;
case X86_REG8_AH:
- snprintf(key, 5, "%%ah");
+ snprintf(key, MAX_REGNAME_LEN, "%%ah");
break;
case X86_REG8_CH:
- snprintf(key, 5, "%%ch");
+ snprintf(key, MAX_REGNAME_LEN, "%%ch");
break;
case X86_REG8_DH:
- snprintf(key, 5, "%%dh");
+ snprintf(key, MAX_REGNAME_LEN, "%%dh");
break;
case X86_REG8_BH:
- snprintf(key, 5, "%%bh");
+ snprintf(key, MAX_REGNAME_LEN, "%%bh");
break;
case X86_REG8_NONE:
/* Ne devrait jamais arriver */
@@ -418,28 +418,28 @@ static void g_x86_register_to_string(const GX86Register *reg, AsmSyntax syntax,
switch (reg->reg.reg16)
{
case X86_REG16_AX:
- snprintf(key, 5, "%%ax");
+ snprintf(key, MAX_REGNAME_LEN, "%%ax");
break;
case X86_REG16_CX:
- snprintf(key, 5, "%%cx");
+ snprintf(key, MAX_REGNAME_LEN, "%%cx");
break;
case X86_REG16_DX:
- snprintf(key, 5, "%%dx");
+ snprintf(key, MAX_REGNAME_LEN, "%%dx");
break;
case X86_REG16_BX:
- snprintf(key, 5, "%%bx");
+ snprintf(key, MAX_REGNAME_LEN, "%%bx");
break;
case X86_REG16_SP:
- snprintf(key, 5, "%%sp");
+ snprintf(key, MAX_REGNAME_LEN, "%%sp");
break;
case X86_REG16_BP:
- snprintf(key, 5, "%%bp");
+ snprintf(key, MAX_REGNAME_LEN, "%%bp");
break;
case X86_REG16_SI:
- snprintf(key, 5, "%%si");
+ snprintf(key, MAX_REGNAME_LEN, "%%si");
break;
case X86_REG16_DI:
- snprintf(key, 5, "%%di");
+ snprintf(key, MAX_REGNAME_LEN, "%%di");
break;
case X86_REG16_NONE:
/* Ne devrait jamais arriver */
@@ -452,28 +452,28 @@ static void g_x86_register_to_string(const GX86Register *reg, AsmSyntax syntax,
switch (reg->reg.reg32)
{
case X86_REG32_EAX:
- snprintf(key, 5, "%%eax");
+ snprintf(key, MAX_REGNAME_LEN, "%%eax");
break;
case X86_REG32_ECX:
- snprintf(key, 5, "%%ecx");
+ snprintf(key, MAX_REGNAME_LEN, "%%ecx");
break;
case X86_REG32_EDX:
- snprintf(key, 5, "%%edx");
+ snprintf(key, MAX_REGNAME_LEN, "%%edx");
break;
case X86_REG32_EBX:
- snprintf(key, 5, "%%ebx");
+ snprintf(key, MAX_REGNAME_LEN, "%%ebx");
break;
case X86_REG32_ESP:
- snprintf(key, 5, "%%esp");
+ snprintf(key, MAX_REGNAME_LEN, "%%esp");
break;
case X86_REG32_EBP:
- snprintf(key, 5, "%%ebp");
+ snprintf(key, MAX_REGNAME_LEN, "%%ebp");
break;
case X86_REG32_ESI:
- snprintf(key, 5, "%%esi");
+ snprintf(key, MAX_REGNAME_LEN, "%%esi");
break;
case X86_REG32_EDI:
- snprintf(key, 5, "%%edi");
+ snprintf(key, MAX_REGNAME_LEN, "%%edi");
break;
case X86_REG32_NONE:
/* Ne devrait jamais arriver */