Incorrect handling of scanf("%*c")

Hi,

I’ve noticed that scanf in CINT doesn’t handle the assignment-suppression character ‘*’ correctly when the list of pointer arguments is empty. The following f1.C code shows the problem for “%c” but other format specifications are also affected.

void f1()
{
  Char_t c;
  scanf("%*c");  
  scanf("%*c%c", &c);
  printf("%c\n", c);
}

CINT fails but the compiled code works as expected

root [0] .x f1.C
Limitation: scanf only takes upto 11 arguments f1.C:4:
*** Interpreter error recovered ***

root [0] .x f1.C++
Info in <TUnixSystem::ACLiC>: creating shared library /home/malusek/test/root/./f1_C.so
123  # my input
3    # output from printf

openSUSE 10.3, x86_64, ROOT 5.21/06

Hi,

thanks for reporting! I would have preferred this report to be on Savannah - it’s just easier for us to track.

I will try to still get it fixed on Monday, so it can make it into the release - but no promises, maybe it only shows up after the release. Either way I’ll let you know!

Cheers, Axel.

Hi,

thanks for your report! This is now fixed and will be part of v5.22.

Cheers, Axel.