Thanks for the note. There are three places where multiplier was calculated, and all three were similar in regards to not casting to float.
The 5.1 branch and main branch were changed in those three places. The change will be available in the next release. Best Regards, -Mike Slifcak Index: agent/mibgroup/ucd-snmp/disk.c =================================================================== RCS file: /cvsroot/net-snmp/net-snmp/agent/mibgroup/ucd-snmp/disk.c,v retrieving revision 5.9 retrieving revision 5.10 diff -r5.9 -r5.10 658c658 < multiplier = vfs.f_bsize / 1024; --- > multiplier = (float)vfs.f_bsize / (float)1024.0; 661c661 < multiplier = vfs.f_frsize / 1024; --- > multiplier = (float)vfs.f_frsize / (float)1024.0; 746c746 < multiplier = filesys.fs_fsize / 1024; --- > multiplier = (float)filesys.fs_fsize / (float)1024.0; Harald Stra�berger wrote: > Hi, > I have found an error in disk.c . On line 661 is a calculation of a > multiplier which is of type float. > But the calculation happens with integers. Therefore if the result is lower > than 1 you will always get 0 (zero). > The effect is that you get for the absolut sizes on disks zero instead of > the correct value. The result is depending on the size of the disk..... > I have tested this on AIX 5.1 but i think this happens on other platforms > too. > > Here is the paragraph which is affected: > > Beginning with line 660 in disk.c > > If (vfs.f_frsize > 255) > multiplier = vfs.f_frsize / 1024; <<<< this is wrong > > Should be: > If (vfs.f_frsize > 255) > multiplier = ( ( float ) vfs.f_frsize ) / 1024.0 ; <<<< this is OK > > > Regards > Harald > ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click _______________________________________________ Net-snmp-coders mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
