Date: 02 Jun 2002 15:58:30 +0200 From: Dag-Erling Smorgrav <des@ofug.org> To: Bruce Evans <bde@zeta.org.au> Cc: Dima Dorfman <dima@trit.org>, <audit@FreeBSD.ORG> Subject: Re: %j for printf(9) Message-ID: <xzpit516aux.fsf@flood.ping.uio.no> In-Reply-To: <20020601233017.Q2458-100000@gamplex.bde.org> References: <20020601233017.Q2458-100000@gamplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Bruce Evans <bde@zeta.org.au> writes:
> When splitting this, you might consider fixing he disorder in it (but fixing
> the external disorder and misarrangement of the other declarations of ints
> should be in a separate patch).
Removed
> Unrelated style fix :-).
Removed
> Another unrelated style fix. This one makes the patch harder to read.
Removed
> Please remove the 'n' case, and check this a bit. I forgot to remove it
> soon after rev.1.48.
Done. It wasn't used anywhere in the kernel. I also took the liberty
of implementing the "real" %n:
case 'n':
if (jflag)
*(va_arg(ap, intmax_t *)) = retval;
else if (qflag)
*(va_arg(ap, quad_t *)) = retval;
else if (lflag)
*(va_arg(ap, long *)) = retval;
else
*(va_arg(ap, int *)) = retval;
break;
> This seems to print all the garbage for %<garbage>. It might be useful
> to mark up the garbage. But gcc will detect the garbage at compile time
> for literal strings.
The original code would print different, possibly incorrect garbage.
DES
--
Dag-Erling Smorgrav - des@ofug.org
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzpit516aux.fsf>
