mirror of
https://github.com/cc65/cc65.git
synced 2024-09-06 18:54:30 +00:00
Use xsprintf
git-svn-id: svn://svn.cc65.org/cc65/trunk@1078 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
d796de8109
commit
426bea8c19
@ -98,29 +98,29 @@ static void CheckLocalOffs (unsigned Offs)
|
|||||||
|
|
||||||
static char* GetLabelName (unsigned flags, unsigned long label, long offs)
|
static char* GetLabelName (unsigned flags, unsigned long label, long offs)
|
||||||
{
|
{
|
||||||
static char lbuf [128]; /* Label name */
|
static char lbuf [256]; /* Label name */
|
||||||
|
|
||||||
/* Create the correct label name */
|
/* Create the correct label name */
|
||||||
switch (flags & CF_ADDRMASK) {
|
switch (flags & CF_ADDRMASK) {
|
||||||
|
|
||||||
case CF_STATIC:
|
case CF_STATIC:
|
||||||
/* Static memory cell */
|
/* Static memory cell */
|
||||||
sprintf (lbuf, "%s%+ld", LocalLabelName (label), offs);
|
xsprintf (lbuf, sizeof (lbuf), "%s%+ld", LocalLabelName (label), offs);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CF_EXTERNAL:
|
case CF_EXTERNAL:
|
||||||
/* External label */
|
/* External label */
|
||||||
sprintf (lbuf, "_%s%+ld", (char*) label, offs);
|
xsprintf (lbuf, sizeof (lbuf), "_%s%+ld", (char*) label, offs);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CF_ABSOLUTE:
|
case CF_ABSOLUTE:
|
||||||
/* Absolute address */
|
/* Absolute address */
|
||||||
sprintf (lbuf, "$%04X", (unsigned)((label+offs) & 0xFFFF));
|
xsprintf (lbuf, sizeof (lbuf), "$%04X", (unsigned)((label+offs) & 0xFFFF));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CF_REGVAR:
|
case CF_REGVAR:
|
||||||
/* Variable in register bank */
|
/* Variable in register bank */
|
||||||
sprintf (lbuf, "regbank+%u", (unsigned)((label+offs) & 0xFFFF));
|
xsprintf (lbuf, sizeof (lbuf), "regbank+%u", (unsigned)((label+offs) & 0xFFFF));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user