adding a new log-format escape

Andrew Shewmaker agshew at gmail.com
Mon Jun 27 16:38:13 GMT 2005


On 6/27/05, Paul Slootman <paul at debian.org> wrote:
> On Mon 27 Jun 2005, YOSHIFUJI Hideaki / ?$B5HF#1QL@ wrote:
> > In article <f4050c9e050626230758147067 at mail.gmail.com> (at Mon, 27 Jun 2005 00:07:19 -0600), Andrew Shewmaker <agshew at gmail.com> says:
> >
> > > +                       for (j = 0; j < SUM_LENGTH; j++ ) {
> > > +                               snprintf(buf2 + j * 2, sizeof buf2,
> > > fmt, file->u.sum[j]);
> >
> >        file->u.sum[j] & 0xff
> >
> > > +                       for (j = 0; j < b; j++ ) {
> > > +                               snprintf(buf2 + j * 2, sizeof buf2,
> > > fmt, file->u.sum[j]);
> >
> > ditto.
> 
> Note also that to preserve the "protection" offered by snprintf, the
> "sizeof buf2" needs to be changed to "sizeof buf2 - j * 2".

Ahh, thanks Yoshfugi.  I thought I had checked that file->u.sum was an
unsigned character array.  Also, thank you, Paul, for pointing out my
snprintf mistake.

-- 
Andrew Shewmaker


More information about the rsync mailing list