Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!pttrnl.nl!AP_vRooijen From: AP_vRooijen@pttrnl.nl (Arthur) Newsgroups: comp.sys.amiga Subject: Lattice C sscanf bug ? Message-ID: Date: 10 Jan 90 13:02:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 34 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 ? 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