There is a bug on sprintf newlib when using specifier %-*.llu

ng boon khai <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <KL1PR0601MB3671369FA0B338FB2D347AEFCDE00@KL1PR0601MB3671.apcprd06.prod.outlook.com>
Hi,

I found a bug when using the newlib sprinf using the spcifier %-*.llu

Below is the code snippet

function (){
  int64_t longval;
  longval=(int64_t)(1);
  char comparebuf[2000];
  sprintf(comparebuf, "testing string! arg1=%-*.llu, arg2=%-*.llu",1,longval,1,longval);
  printf(comparebuf);
}

And i get this outcome
testing string! arg1=499644, arg2=

Expected outcome should be
testing string! arg1=1, arg2=1

Regards,
Ng Boon Khai.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.