Xref: utzoo comp.sys.amiga:47578 comp.sys.amiga.tech:9336 Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!hp4nl!dnlunx!arian From: arian@dnlunx.pttrnl.nl (Koster A.) Newsgroups: comp.sys.amiga,comp.sys.amiga.tech Subject: bug in lattice c 5.02 sscanf ? Keywords: sscanf, lattice c 5.02 Message-ID: <888@dnlunx.pttrnl.nl> Date: 11 Jan 90 10:03:36 GMT Distribution: comp Organization: PTT Research Neher Laboratorium Lines: 35 Hello world, I want to read the field width of a input format string. eg from "%5s" I want to read 5. I'm using the following C program written with Lattice C 5.02 #include main() { int n,field_width; char string[]="%5s"; n=sscanf(string,"%%%ds",&field_width); printf("n=%1d, field_width=%d\n",n,field_width); } The sscanf isn't working correctly. When I use the format string "%%ds" it is n=sscanf(string,"%%ds",&field_width); Is this a bug from Lattice c 5.02 ? and is it fixed in 5.04 ? Arthur van Rooijen RNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRN * * * PTT Research Neher Laboratorium, Phone : +31703325092 * * 2260 AK Leidschendam, Telefax: +31703326477 * * P.O. box 421, E-mail: ap_vrooijen@pttrnl.nl * * The Netherlands. * * * RNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRNLRN