1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-09 01:28:58 +00:00

Handling of the '+' and ' ' flags was incorrect if the value was negative

git-svn-id: svn://svn.cc65.org/cc65/trunk@389 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2000-10-21 21:52:21 +00:00
parent 7eae698264
commit 3b7f8eeaab

View File

@ -148,15 +148,26 @@ flags_done:
case 'd': case 'd':
case 'i': case 'i':
if (addsign) { if (islong) {
*s++ = '+'; l = va_arg (ap, long);
} else if (addblank) { if (l >= 0) {
*s++ = ' '; if (addsign) {
} *s++ = '+';
if (islong) { } else if (addblank) {
ltoa (va_arg (ap, long), s, 10); *s++ = ' ';
} else { }
itoa (va_arg (ap, int), s, 10); }
ltoa (l, s, 10);
} else {
i = va_arg (ap, int);
if (i >= 0) {
if (addsign) {
*s++ = '+';
} else if (addblank) {
*s++ = ' ';
}
}
itoa (i, s, 10);
} }
break; break;