mescc: Support binutils 2.20.1: vfprint, vsprintf: %llx.

* lib/libc+tcc.c (vfprintf, vsprintf): Handle %%llx.  Print error:
  should we skip another int, va_arg a long long?
This commit is contained in:
Jan Nieuwenhuizen 2018-06-24 17:26:53 +02:00
parent 2551eef953
commit 41a6585295
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273

View file

@ -682,8 +682,6 @@ vfprintf (FILE* f, char const* format, va_list ap)
int left_p = 0; int left_p = 0;
int precision = -1; int precision = -1;
int width = -1; int width = -1;
if (c == 'l')
c = *++p;
if (c == '-') if (c == '-')
{ {
left_p = 1; left_p = 1;
@ -721,6 +719,11 @@ vfprintf (FILE* f, char const* format, va_list ap)
} }
if (c == 'l') if (c == 'l')
c = *++p; c = *++p;
if (c == 'l')
{
eputs ("vfprintf: skipping second: l\n");
c = *++p;
}
switch (c) switch (c)
{ {
case '%': {fputc (*p, fd); count++; break;} case '%': {fputc (*p, fd); count++; break;}
@ -906,8 +909,6 @@ vsprintf (char *str, char const* format, va_list ap)
int left_p = 0; int left_p = 0;
int precision = -1; int precision = -1;
int width = -1; int width = -1;
if (c == 'l')
c = *++p;
if (c == '-') if (c == '-')
{ {
left_p = 1; left_p = 1;
@ -945,6 +946,13 @@ vsprintf (char *str, char const* format, va_list ap)
} }
if (c == 'l') if (c == 'l')
c = *++p; c = *++p;
if (c == 'l')
c = *++p;
if (c == 'l')
{
eputs ("vfprintf: skipping second: l\n");
c = *++p;
}
switch (c) switch (c)
{ {
case '%': {*str++ = *p; count++; break;} case '%': {*str++ = *p; count++; break;}