From owner-freebsd-bugs Fri Sep 18 11:21:05 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA03199 for freebsd-bugs-outgoing; Fri, 18 Sep 1998 11:21:05 -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 LAA03079 for ; Fri, 18 Sep 1998 11:20:37 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id LAA00445; Fri, 18 Sep 1998 11:20:06 -0700 (PDT) Date: Fri, 18 Sep 1998 11:20:06 -0700 (PDT) Message-Id: <199809181820.LAA00445@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.ORG From: Niall Smart Subject: Re: bin/7970: Bug in *scanf: %n is sometimes ignored. Reply-To: Niall Smart 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: Niall Smart To: "Jin Guojun (ITG staff)" Cc: freebsd-gnats-submit@freebsd.org Subject: Re: bin/7970: Bug in *scanf: %n is sometimes ignored. Date: Fri, 18 Sep 1998 14:23:37 +0100 > > The following code demonstrates the bug: > > > > 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. Whoops, a miscreant "2" slipped in there somehow, the format string should be "4\n". Niall To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message