[yast-commit] r38099 - in /branches/SuSE-SLE-10-SP1-Branch/ncurses: VERSION package/yast2-ncurses.changes src/NCPopupDiskspace.cc
![](https://seccdn.libravatar.org/avatar/9d45ad4c714db4d170a42527a4a6b8dc.jpg?s=120&d=mm&r=g)
Author: gs Date: Wed May 23 12:03:18 2007 New Revision: 38099 URL: http://svn.opensuse.org/viewcvs/yast?rev=38099&view=rev Log: check whether partition size is zero (bug #270836) Modified: branches/SuSE-SLE-10-SP1-Branch/ncurses/VERSION branches/SuSE-SLE-10-SP1-Branch/ncurses/package/yast2-ncurses.changes branches/SuSE-SLE-10-SP1-Branch/ncurses/src/NCPopupDiskspace.cc Modified: branches/SuSE-SLE-10-SP1-Branch/ncurses/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/ncurses/VERSION?rev=38099&r1=38098&r2=38099&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP1-Branch/ncurses/VERSION (original) +++ branches/SuSE-SLE-10-SP1-Branch/ncurses/VERSION Wed May 23 12:03:18 2007 @@ -1 +1 @@ -2.13.66 +2.13.67 Modified: branches/SuSE-SLE-10-SP1-Branch/ncurses/package/yast2-ncurses.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/ncurses/package/yast2-ncurses.changes?rev=38099&r1=38098&r2=38099&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP1-Branch/ncurses/package/yast2-ncurses.changes (original) +++ branches/SuSE-SLE-10-SP1-Branch/ncurses/package/yast2-ncurses.changes Wed May 23 12:03:18 2007 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Wed May 23 11:40:29 CEST 2007 - gs@suse.de + +- Package Installation: check the partition size to prevent + division by zero during disk space calculation (bug #270836) +- 2.13.67 + +------------------------------------------------------------------- Tue Mar 6 09:59:22 CET 2007 - kmachalkova@suse.cz - initscr() code is back - needed for running yast clients from Modified: branches/SuSE-SLE-10-SP1-Branch/ncurses/src/NCPopupDiskspace.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/ncurses/src/NCPopupDiskspace.cc?rev=38099&r1=38098&r2=38099&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP1-Branch/ncurses/src/NCPopupDiskspace.cc (original) +++ branches/SuSE-SLE-10-SP1-Branch/ncurses/src/NCPopupDiskspace.cc Wed May 23 12:03:18 2007 @@ -236,8 +236,12 @@ { FSize usedSize ( partition.pkg_size, FSize::K ); FSize totalSize ( partition.total_size, FSize::K ); - - int percent = ( 100 * usedSize ) / totalSize; + + int percent = 0; + + if ( totalSize != 0 ) + 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
participants (1)
-
gs@svn.opensuse.org