[net.micro.pc] Lattice C, V2.14, fails simply sscanf

dob@ihu1n.UUCP (Daniel M. O'Brien) (02/17/85)

I have been fighting an interesting but frustrating bug with
the Lattice C compiler V2.14 for the IBM-PC. The following 
program distills the problem down to it's essence. It appears
that a simple sscan() is failing. When I try this same program on
UNIX SysV R2, all is well. Here's the program:
/*-----*/
int	a, b, n;

main()
{
	n = sscanf("  a  1  b  2  ", " a %d b %d ", &a, &b);

	printf("n=%d\ta=%d\tb=%d\n", n, a, b);
}
/*-----*/
It prints out the following:
n=0	a=0	b=0

What it should print out is (obviously)
n=2	a=1	b=2

If I remove the leading blanks from the first string yielding
	n = sscanf("a  1  b  2  ", " a %d b %d ", &a, &b);
the program prints out:
n=2	a=1	b=0
thus failing to initialize b.

I am going to ship this off to Lifeboat and see what they say about it.
But what I need now is a quick work-around. Anybody else run into this
problem and worked around it?

Thanks in advance.