/* Truncate negative numbers on >32-bit hosts. */
number &= 0xffffffff;
- sprintf (outbuffer, "0x%lx", number);
-
/* Save this value for the "case" support. */
if (TRACE_CASE)
last_immediate = number;
- return outbuffer + strlen (outbuffer);
+ return outbuffer + sprintf (outbuffer, "0x%lx", number);
}
/* Format number as decimal into outbuffer. Parameter signedp says
static char *
format_reg (struct cris_disasm_data *disdata,
int regno,
- char *outbuffer_start,
+ char *outbuffer,
bool with_reg_prefix)
{
- char *outbuffer = outbuffer_start;
-
if (with_reg_prefix)
*outbuffer++ = REGISTER_PREFIX_CHAR;
case 15:
/* For v32, there is no context in which we output PC. */
if (disdata->distype == cris_dis_v32)
- strcpy (outbuffer, "acr");
+ outbuffer = stpcpy (outbuffer, "acr");
else
- strcpy (outbuffer, "pc");
+ outbuffer = stpcpy (outbuffer, "pc");
break;
case 14:
- strcpy (outbuffer, "sp");
+ outbuffer = stpcpy (outbuffer, "sp");
break;
default:
- sprintf (outbuffer, "r%d", regno);
+ outbuffer += sprintf (outbuffer, "r%d", regno);
break;
}
- return outbuffer_start + strlen (outbuffer_start);
+ return outbuffer;
}
/* Format the name of a support register into outbuffer. */
static char *
format_sup_reg (unsigned int regno,
- char *outbuffer_start,
+ char *outbuffer,
bool with_reg_prefix)
{
- char *outbuffer = outbuffer_start;
int i;
if (with_reg_prefix)
for (i = 0; cris_support_regs[i].name != NULL; i++)
if (cris_support_regs[i].number == regno)
- {
- sprintf (outbuffer, "%s", cris_support_regs[i].name);
- return outbuffer_start + strlen (outbuffer_start);
- }
+ return stpcpy (outbuffer, cris_support_regs[i].name);
/* There's supposed to be register names covering all numbers, though
some may be generic names. */
- sprintf (outbuffer, "format_sup_reg-BUG");
- return outbuffer_start + strlen (outbuffer_start);
+ return stpcpy (outbuffer, "format_sup_reg-BUG");
}
/* Return the length of an instruction. */