From owner-freebsd-current Sun Feb 9 10: 0: 8 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A732837B401 for ; Sun, 9 Feb 2003 10:00:07 -0800 (PST) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6311643F85 for ; Sun, 9 Feb 2003 10:00:07 -0800 (PST) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 2DDDBAE27F; Sun, 9 Feb 2003 10:00:02 -0800 (PST) Date: Sun, 9 Feb 2003 10:00:02 -0800 From: Alfred Perlstein To: "M. Warner Losh" Cc: current@FreeBSD.ORG Subject: Re: syslog bug Message-ID: <20030209180002.GR88781@elvis.mu.org> References: <20030208210824.GK88781@elvis.mu.org> <20030209.093600.122405559.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030209.093600.122405559.imp@bsdimp.com> User-Agent: Mutt/1.4i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * M. Warner Losh [030209 08:39] wrote: > In message: <20030208210824.GK88781@elvis.mu.org> > Alfred Perlstein writes: > : syslog(3) botches things if you pass it a string that has "%%m" in it. > : this should fix it, any comments? > : > > With the above fix, "fred %%m" will produce > 'fred %%ERRNO-ERROR-MESSAGE' would it not? Isn't there one too many > fputc(ch, fmt_fp) in the case where you detect %%? > > + ++fmt; > + fputc(ch, fmt_fp); > > instead in the '%%' if statement. This would print only one '%' ala > printf. Heh, the format string is passed through printf later, we don't want to eat the extra % otherwise it will cause problems for us. -- -Alfred Perlstein [alfred@freebsd.org] 'Instead of asking why a piece of software is using "1970s technology," start asking why software is ignoring 30 years of accumulated wisdom.' To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message