Skip to content

Commit

Permalink
Merge pull request #1511 from berryzplus/feature/fix_devide_by_zero
Browse files Browse the repository at this point in the history
SonarCloud解析で検出されたゼロ除算コードに対策する
  • Loading branch information
berryzplus committed Jan 23, 2021
2 parents 6975209 + bb3be3d commit d1bd398
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sakura_core/cmd/CViewCommander_Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,11 @@ void CViewCommander::Command_TILE_V( void )
// To Here Jul. 28, 2002 genta
count++;
}
if( count == 0 ){
delete[] phwndArr;
delete[] pEditNodeArr;
return;
}
int height = (rcDesktop.bottom - rcDesktop.top ) / count;
for(i = 0; i < count; ++i ){
// Jul. 21, 2002 genta
Expand Down Expand Up @@ -350,6 +355,11 @@ void CViewCommander::Command_TILE_H( void )
// To Here Jul. 28, 2002 genta
count++;
}
if (count == 0) {
delete[] phwndArr;
delete[] pEditNodeArr;
return;
}
int width = (rcDesktop.right - rcDesktop.left ) / count;
for(i = 0; i < count; ++i ){
// Jul. 21, 2002 genta
Expand Down

0 comments on commit d1bd398

Please sign in to comment.