svn commit: samba r11255 - in trunk/source: libsmb passdb

Jeremy Allison jra at samba.org
Sat Oct 22 00:50:34 GMT 2005


On Fri, Oct 21, 2005 at 08:49:45PM -0400, derrell at samba.org wrote:
> jra at samba.org writes:
> 
> > Author: jra
> > Date: 2005-10-21 22:48:15 +0000 (Fri, 21 Oct 2005)
> > New Revision: 11255
> 
> 
> > Log:
> > Remove use of long long and strtoll in libsmbclient (we
> > @@ -4201,8 +4200,8 @@
> >                                  if (determine_size) {
> >                                          p = talloc_asprintf(
> >                                                  ctx,
> > -                                                ",SIZE:%llu",
> > -                                                (unsigned long long) size);
> > +                                                ",SIZE:%.0f",
> > +                                                (double)size);
> >                                          if (!p) {
> >                                                  errno = ENOMEM;
> >                                                  return -1;
> 
> If we're using %.0f as the format strings, then the cast on each of these
> should be to float.  If we want to cast to double, the format string should be
> %.0lf.

Nope. From the printf format argument spec :

"f,F    The  double argument is rounded and converted to decimal notation"

Remember, there's no such thing as float as a function arg, it's
always cast to double, just like char -> int.

Jeremy.


More information about the samba-technical mailing list