From owner-freebsd-bugs Fri Sep 18 11:20:54 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA03134 for freebsd-bugs-outgoing; Fri, 18 Sep 1998 11:20:54 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA03038 for ; Fri, 18 Sep 1998 11:20:27 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id LAA00404; Fri, 18 Sep 1998 11:20:03 -0700 (PDT) Date: Fri, 18 Sep 1998 11:20:03 -0700 (PDT) Message-Id: <199809181820.LAA00404@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.ORG From: Jin Guojun (ITG staff) Subject: Re: bin/7970: Bug in *scanf: %n is sometimes ignored. Reply-To: Jin Guojun (ITG staff) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR bin/7970; it has been noted by GNATS. From: Jin Guojun (ITG staff) To: freebsd-gnats-submit@FreeBSD.ORG, nialls@euristix.ie Cc: Subject: Re: bin/7970: Bug in *scanf: %n is sometimes ignored. Date: Fri, 18 Sep 1998 07:07:22 -0700 (PDT) > The following code demonstrates the bug: > > #include > > int > main() > { > int i; > int n = 12345678; > > sscanf("24\n", "%li %n", &i, &n); > > printf("%d %d\n", i, n); > > return 0; > } > > The output should be "4 2", but it is "4 12345678"; n is not > ... The output should be "24 3", you have 3 bytes in the stream and the first "%li" is 24. If you got "4 2", then it is completely wrong somewhere. -Jin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message