fix awk format printing bugs (thanks aiju)
This commit is contained in:
parent
713beb6d42
commit
db7d1ed2b1
1 changed files with 6 additions and 3 deletions
|
@ -895,18 +895,21 @@ int format(char **pbuf, int *pbufsize, char *s, Node *a) /* printf-like conversi
|
|||
case 'd': case 'i':
|
||||
flag = 2;
|
||||
if(*(s-1) == 'l') break;
|
||||
*(t-1) = 'l';
|
||||
t[-1] = 'l';
|
||||
*t = 'd';
|
||||
*++t = '\0';
|
||||
break;
|
||||
case 'u':
|
||||
flag = *(s-1) == 'l' ? 2 : 3;
|
||||
*t++ = 'u';
|
||||
t[-1] = 'u';
|
||||
*t++ = 'd';
|
||||
*t = '\0';
|
||||
break;
|
||||
case 'o': case 'x': case 'X':
|
||||
flag = *(s-1) == 'l' ? 2 : 3;
|
||||
t[-1] = 'u';
|
||||
*t++ = *s;
|
||||
*t = '\0';
|
||||
break;
|
||||
case 's':
|
||||
flag = 4;
|
||||
|
|
Loading…
Reference in a new issue