Author: gs Date: Tue Sep 11 15:32:34 2007 New Revision: 40850 URL: http://svn.opensuse.org/viewcvs/yast?rev=40850&view=rev Log: check the partition size to prevent division by zero during disk space calculation (bug #303700) Modified: branches/SuSE-Linux-10_2-Branch/ncurses/VERSION branches/SuSE-Linux-10_2-Branch/ncurses/package/yast2-ncurses.changes branches/SuSE-Linux-10_2-Branch/ncurses/src/NCPopupDiskspace.cc Modified: branches/SuSE-Linux-10_2-Branch/ncurses/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-10_2-Branch/ncurses/VERSION?rev=40850&r1=40849&r2=40850&view=diff ============================================================================== --- branches/SuSE-Linux-10_2-Branch/ncurses/VERSION (original) +++ branches/SuSE-Linux-10_2-Branch/ncurses/VERSION Tue Sep 11 15:32:34 2007 @@ -1 +1 @@ -2.14.4 +2.14.5 Modified: branches/SuSE-Linux-10_2-Branch/ncurses/package/yast2-ncurses.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-10_2-Branch/ncurses/package/yast2-ncurses.changes?rev=40850&r1=40849&r2=40850&view=diff ============================================================================== --- branches/SuSE-Linux-10_2-Branch/ncurses/package/yast2-ncurses.changes (original) +++ branches/SuSE-Linux-10_2-Branch/ncurses/package/yast2-ncurses.changes Tue Sep 11 15:32:34 2007 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Tue Sep 11 15:09:47 CEST 2007 - gs@suse.de + +- Package installation: check the partition size to prevent + division by zero during disk space calculation (bug #303700) +- 2.14.5 + +------------------------------------------------------------------- Wed Nov 29 16:55:14 CET 2006 - kmachalkova@suse.cz - Display updated patches also in 'installable' view (not only in Modified: branches/SuSE-Linux-10_2-Branch/ncurses/src/NCPopupDiskspace.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-10_2-Branch/ncurses/src/NCPopupDiskspace.cc?rev=40850&r1=40849&r2=40850&view=diff ============================================================================== --- branches/SuSE-Linux-10_2-Branch/ncurses/src/NCPopupDiskspace.cc (original) +++ branches/SuSE-Linux-10_2-Branch/ncurses/src/NCPopupDiskspace.cc Tue Sep 11 15:32:34 2007 @@ -236,8 +236,12 @@ { FSize usedSize ( partition.pkg_size, FSize::K ); FSize totalSize ( partition.total_size, FSize::K ); + + int percent = 0; + + if ( totalSize != 0 ) + percent = ( 100 * usedSize ) / totalSize; - int percent = ( 100 * usedSize ) / totalSize; int free = ( totalSize - usedSize ) / FSize::MB; NCMIL << "Partition: " << partition.dir << " Used percent: " @@ -293,6 +297,8 @@ // void NCPopupDiskspace::setDiskSpace( wint_t ch ) { + int percent = 0; + // set diskspace values in ZyppDuSet testDiskSpace for ( ZyppDuSetIterator it = testDiskUsage.begin(); it != testDiskUsage.end(); @@ -302,7 +308,9 @@ FSize usedSize ( partitionDu.pkg_size, FSize::K ); FSize totalSize ( partitionDu.total_size, FSize::K ); - int percent = ( 100 * usedSize ) / totalSize; + + if ( totalSize != 0 ) + percent = ( 100 * usedSize ) / totalSize; if ( ch == '+' ) percent += 3; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org