Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Jan 2001 18:49:21 +0000
From:      Ben Smithurst <ben@FreeBSD.org>
To:        Chris Faulhaber <jedgar@fxp.org>
Cc:        Brian Somers <brian@Awfulhak.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/usr.bin/apply apply.c
Message-ID:  <20010105184921.M85794@strontium.scientia.demon.co.uk>
In-Reply-To: <20010105120633.B66833@peitho.fxp.org>
References:  <jedgar@fxp.org> <200101050206.f0526rB87964@hak.lan.Awfulhak.org> <20010105162917.K85794@strontium.scientia.demon.co.uk> <20010105120633.B66833@peitho.fxp.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Chris Faulhaber wrote:

> However, I think that
> 
>      These functions return the number of characters printed (not including
>      the trailing `\0' used to end output to strings).
> 
> should be associated only with the appropriate functions (sprintf(),
> vsprintf()) especially since those it does not apply to already mention
> their return values.

I don't agree with that, since the other functions return the number of
characters printed as well.

ben@strontium:~/tmp$ cat t.c
int
main(void) {
        int n;
        char *p;

        n = printf("foo\n");
        printf("n=%d\n", n);

        n = asprintf(&p, "%d %d", 123, 456);
        printf("p=%s n=%d\n", p, n);

	/* etc */

        return (0);
}
ben@strontium:~/tmp$ ./a.out
foo
n=4
p=123 456 n=7

-- 
Ben Smithurst / ben@FreeBSD.org / PGP: 0x99392F7D


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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