Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Feb 2003 10:00:02 -0800
From:      Alfred Perlstein <bright@mu.org>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        current@FreeBSD.ORG
Subject:   Re: syslog bug
Message-ID:  <20030209180002.GR88781@elvis.mu.org>
In-Reply-To: <20030209.093600.122405559.imp@bsdimp.com>
References:  <20030208210824.GK88781@elvis.mu.org> <20030209.093600.122405559.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
* M. Warner Losh <imp@bsdimp.com> [030209 08:39] wrote:
> In message: <20030208210824.GK88781@elvis.mu.org>
>             Alfred Perlstein <bright@mu.org> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030209180002.GR88781>