From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Jan_Dj=E4rv?= Newsgroups: gmane.emacs.devel Subject: Re: fix the sscanf usage in etags Date: Thu, 10 Aug 2006 08:47:16 +0200 Message-ID: <44DAD674.7030407@swipnet.se> References: <20060807.123850.192456906.jet@gyve.org> <87psfa93i7.fsf@zip.com.au> <44D9874B.3040206@swipnet.se> <87k65ho38v.fsf@zip.com.au> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1155192484 1237 80.91.229.2 (10 Aug 2006 06:48:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 10 Aug 2006 06:48:04 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 10 08:48:01 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GB4Ki-000497-Bn for ged-emacs-devel@m.gmane.org; Thu, 10 Aug 2006 08:47:56 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GB4Kh-0008PO-Td for ged-emacs-devel@m.gmane.org; Thu, 10 Aug 2006 02:47:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GB4KS-0008Mr-KN for emacs-devel@gnu.org; Thu, 10 Aug 2006 02:47:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GB4KQ-0008KC-To for emacs-devel@gnu.org; Thu, 10 Aug 2006 02:47:40 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GB4KQ-0008Jq-Ny for emacs-devel@gnu.org; Thu, 10 Aug 2006 02:47:38 -0400 Original-Received: from [81.228.8.180] (helo=av9-2-sn2.hy.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GB4PH-0001Ew-HP for emacs-devel@gnu.org; Thu, 10 Aug 2006 02:52:39 -0400 Original-Received: by av9-2-sn2.hy.skanova.net (Postfix, from userid 502) id 6CE4B37F6E; Thu, 10 Aug 2006 08:47:37 +0200 (CEST) Original-Received: from smtp4-1-sn2.hy.skanova.net (smtp4-1-sn2.hy.skanova.net [81.228.8.92]) by av9-2-sn2.hy.skanova.net (Postfix) with ESMTP id 5F1B937E80; Thu, 10 Aug 2006 08:47:37 +0200 (CEST) Original-Received: from coolsville.localdomain (81-235-205-204-no59.tbcn.telia.com [81.235.205.204]) by smtp4-1-sn2.hy.skanova.net (Postfix) with ESMTP id 68E0B37E44; Thu, 10 Aug 2006 08:47:36 +0200 (CEST) User-Agent: Thunderbird 1.5.0.5 (X11/20060808) Original-To: Kevin Ryde In-Reply-To: <87k65ho38v.fsf@zip.com.au> X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:58252 Archived-At: Kevin Ryde skrev: > Masatake YAMATO writes: >> The problem I found was that etags crashed when `#line 123 L"wide"' wa= s given >> as input. If the crashing can be suppressed, it is enough. >=20 > That's the only bad case, you don't have some strange libc that > incorrectly counts %n? >=20 > Jan Dj=E4rv writes: >> if (sscanf (lbp->buffer, "#line %d %n\"", &lno, &start) >=3D 1 >> && lbp->buffer[start] =3D=3D '"') >=20 > I think that still uses start uninitialized on say "#line 123 ". No, in that case start will be 10. If the %d matches, sscanf will return = 1 and=20 in that case %n must match (whitespace is optional). Jan D.