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

2005-10-21 Thread derrell
[EMAIL PROTECTED] writes:

 Author: jra
 Date: 2005-10-21 22:48:15 + (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.

Derrell


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

2005-10-21 Thread Jeremy Allison
On Fri, Oct 21, 2005 at 08:49:45PM -0400, [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] writes:
 
  Author: jra
  Date: 2005-10-21 22:48:15 + (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,FThe  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.


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

2005-10-21 Thread derrell
Jeremy Allison [EMAIL PROTECTED] writes:

 Nope. From the printf format argument spec :

 f,FThe  double argument is rounded and converted to decimal notation

Yup, you're right.  I was thinking of scanf() format strings.  Sorry.

Derrell